网格选择的索引不起作用. [英] Grid selected index not working.

查看:51
本文介绍了网格选择的索引不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个网站.

创建一个table并将网格放置在td中.
当我单击grid的值时,它不起作用.

I created a web site.

Created a table and placed a Grid in a td.
When I am clicking the value of grid it''s not working.

gridloanofficer_SelectedIndexChanged(object sender, EventArgs e)
{
}



我使用了一个链接按钮,然后我可以单击该值并转到Selected indexchanged(),

我使用字符串nm = gridloanpeople.SelectedRow.Cells [0] .tostring();

但是我没有得到值.



I used a link button then now I can click the value and got to Selected indexchanged(),

I use string nm = gridloanofficer.SelectedRow.Cells[0].tostring();

But I not get the value.

推荐答案

1)在该网格的项目模板上单击链接按钮.
2)并给该Linkbutton的CommandName ="Select"

单击该链接按钮,将触发选定索引".
1)take a link button on that grid''s item template .
2)And give CommandName="Select" of that Linkbutton

click on that link button and Selected Index Will be fired.


在开始编写代码之前,您需要阅读有关datagrid的信息:

看看他们:
DataGrid类 [ ^ ]
有关DataGrid Web服务器控件的热门问题 [ GridView快速入门 [
You need to read about datagrid''s before starting to code:

Have a look at them:
DataGrid Class[^]
Top Questions about the DataGrid Web Server Control[^]
GridView Quickstart[^]


给出命令名称并您可以在rowediting事件中处理该问题....
Give the command name and u can handle that in rowediting event.....


这篇关于网格选择的索引不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆