从Datagrid视图中获取值的问题 [英] Problem To fetch Value From Datagrid View

查看:105
本文介绍了从Datagrid视图中获取值的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有语言的asp.net作为vb。

我在网格视图中有两个文本字段

tb1作为cell1,tb2作为数据网格视图中的单元格2

现在我想使用像






的代码从那些textfield im中获取值
datagridview1.rows(0).cells(1).text(在asp.net中找不到值)

但总是返回值(空白/空)



帮帮我

i am using asp.net with language as vb .
I take a grid view with having two textfield
tb1 as cell1,tb2 as cell 2 in datagrid view
now i want to fetch values from those textfield i m using the code like



datagridview1.rows(0).cells(1).text(value is not found in asp.net )
but always it returns the value ""(Blank/Null)

Help me

推荐答案

嗨Ankur,



或许datagridview1.rows(0)指的是DataGridView的Header Row,

尝试使用rows(1):

Hi Ankur,

Perhaps datagridview1.rows(0) is referring to the Header Row of the DataGridView,
Try rows(1) instead:
datagridview1.rows(1).cells(1).text(...);





也有可能 -

问题不清楚,但它也可以该文本位于单元格内的控件内,在这种情况下,您首先必须到达控件然后是它的文本属性。





干杯,

Edo



Also a possibility -
Not clear from the question, but it can also be that the text is inside a control inside the cell, in which case you''d first have to reach the control and then the text property of it.


Cheers,
Edo

这篇关于从Datagrid视图中获取值的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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