如何使用复选框column访问gridview的行? [英] how to access a row of a gridview using checkbox coloumn?

查看:92
本文介绍了如何使用复选框column访问gridview的行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在gridview控件中访问选定行的字段..
请帮助我..

how to access a field of the selected row in a gridview control..
Please help me..

推荐答案

在哪里访问它?在客户端,您可以为复选框提供该行中所需控件的ID.在服务器上,您需要遍历行并找出要检查的行,这意味着在prerender事件发生之前不将网格绑定到数据源.
Access it, where ? On the client side, you can give your checkbox the id of the control you want in the row. On the server, you need can iterate over the rows and find out which ones are checked, which means not binding the grid to a data source before the prerender event.


<br />
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)<br />
        {<br />
            grdDataForm.Rows[].Cells[].<br />
}<br />



试试这个

选定的行在SelectedIndex属性中可用,您可以通过在Cells [index]



Try this

selected row is available in SelectedIndex property and you can get particular column by passing necessary index in Cells[index]


这篇关于如何使用复选框column访问gridview的行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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