网格视图索引值 [英] Grid view Index value

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

问题描述

我需要知道这行和小麦的确切含义是什么.请有人对此给我清楚的解释.

I need to know what is the exact meaning for this line and wheat it does. Pls someone give me clear explanation on this.

Mygrid.Rows[e.RowIndex].Cells[0].Text;

推荐答案

Gridview以表格式绑定数据.它是定义格式,例如行和列

------------------
id |名称|
---- | ------------ |
1 |拉克什|
---- | ------------ |
2 |约瑟夫|
---- | ------------ |

e.RowIndex

这是您在网格视图中单击的行

.Cells [0] .Text;
此均值第0个单元格值

Mygrid.Rows [e.RowIndex] .Cells [0] .Text;

这意味着Gridview中的第N行第0个单元格值

(即)如果您单击第二行,那么结果将是第二行第一单元格值-2

(即)如果您想要上方网格第二行的单元格1的值,则可以编写

Mygrid.Rows [1] .Cells [1] .Text;

结果将是:Joseph
Gridview bind data in Table format. it is define format like Rows and Columns

------------------
id | name |
----|------------|
1 | Rakesh |
----|------------|
2 | Joseph |
----|------------|

e.RowIndex

This is Which row you have been clicked in the grid view

.Cells[0].Text;
This Mean 0 th cell Value

Mygrid.Rows[e.RowIndex].Cells[0].Text;

This mean the N th row of 0 th cell value in the Gridview

(ie) if you clicked second row then the result would be second row first cell value - 2

(ie) if you want the values of cell 1 of second row of above grid so you can write

Mygrid.Rows[1].Cells[1].Text;

the Result would be : Joseph


获取第e.RowIndex行和第0列(第一列)的网格单元格的Text属性(字符串) .使用此类属性不执行任何操作.
Gets the Text property (a string) of the grid''s cell at row e.RowIndex, and column 0 (the first column). Does nothing with such property.


这篇关于网格视图索引值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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