如何从grideview中检索行及其值 [英] how to retrieve the row and its value from the grideview

查看:116
本文介绍了如何从grideview中检索行及其值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检索gridview中行内的值。

但我启用了自动生成的编辑按钮和自动生成的列,因为我在下拉列表中选择数据库和表,然后我打开表通过gridview.For编辑我将点击编辑按钮,它将编辑后将其所有值传输到文本框,我想要所有单元格值请告诉我如何获得,,,,

i二手但它返回null

i want to retrieve the values inside the row in gridview.
but i enable the autogenerated edit button and autogenerated column because i am selecting the database and table in the dropdownlist and then i open the table through the gridview.For editing i will clicks the edit button it will transfer all its values to the textbox after editing, i want that all cell values please tell me how can i get ,,,,
i used this but it returns null

  int rowindex = Convert.ToInt32(e.RowIndex);
string column_name = GridView4.Rows[rowindex].Cells[2].Text;

推荐答案





编辑后点击更新按钮阅读那时的所有文本框值。


After editing when you click on update button read all the textbox values at that time.


HI,



您可以通过将单元格值分配到隐藏字段来完成此操作将数据绑定到网格。当您尝试访问编辑按钮上的值时,您可以轻松地从隐藏字段中获取值。试试这样。



如何在网格视图中编辑和更新行值?

编辑,更新gridview中的行





谢谢


You can do this by assigning the cell values into hidden fields while binding the data to the grid. And when you are trying to access the value on the edit button click you can get the values from the hidden fields easily. Try like this.

how to edit and update row values in grid view?
edit,update row in gridview


Thanks


这篇关于如何从grideview中检索行及其值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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