如何从网格中读取特定的单元格值... [英] how to read a particular cell value from grid....

查看:62
本文介绍了如何从网格中读取特定的单元格值...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从网格中读取特定的单元格值..............?

how to read a particular cell value from grid..............?

推荐答案

尝试如下:
GridView1.SelectedRow.Cells(0).Text
在gridview中的selectedIndexChange事件
try like this:
GridView1.SelectedRow.Cells(0).Text
in gridview selectedIndexChange event
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
       Response.Write(GridView1.SelectedRow.Cells(0).Text)
   End Sub


实际上有不同的方法从特定单元格访问值.因此,请指定您要访问的事件.

如果行中有按钮控件,则可以使用rowcommand事件. (被称为泡沫事件)

如果要从外部访问gridview,则可以使用foreach循环

如果是绑定字段,则可以使用.cells [0]属性.如果是其他控件,则可以使用.findcontrol("),然后获取这些值.

请提供有关您的问题/问题的明确详细信息,以免出现任何麻烦.

:-)
Actually there are different ways to access values from particular cell. so, specify on which event you want to access.

If you have button control in row then u can use rowcommand event. (It is known as bubble event)

If you are accessing gridview from outside then you can use foreach loop

You can use .cells[0] property if it is bound field. and if it is other control then you can use .findcontrol("") and then get those value.

Please give clear details about your problem/issue so that there should not be any gesswork.

:-)


我想从网格中获取列值.它的绑定字段是.pls指定..i如何使用
dispoid = gvReport.Rows(e.RowIndex).Cells(0).Text和
也dispoid = Rows.Cells(0).Text
出现这样的错误

错误2"RowIndex"不是"System.EventArgs"的成员.

但无法返回d行值...请帮助...
i want to fetch a column value from grid..its a bound field..pls specify how..i used
dispoid = gvReport.Rows(e.RowIndex).Cells(0).Text and
also dispoid = Rows.Cells(0).Text
am getting an error like this

Error 2 ''RowIndex'' is not a member of ''System.EventArgs''.

but couldnt return d row value...plz help...


这篇关于如何从网格中读取特定的单元格值...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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