2010-08-20 117 views
0

我想在aspx页面上的Grid view单元格中选择一个值。 我需要的VB.NET代码要做到这一点在GridView中选择单元格的值

在C#代码将是这样的:

string id = GridView1.Rows[e.RowIndex].Cells[1].Text 

有人能帮助我吗?

回答

0

我尝试了一些编码,该编码的Visual Studio提示,这做我想要的东西:

Dim id As string = GridView1.SelectedRow.Cells(1).Text 
1

那么您可以在其他时间使用此页面。 http://www.developerfusion.com/tools/convert/csharp-to-vb/

Dim id As String = GridView1.Rows(e.RowIndex).Cells(1).Text 
+0

感谢名单! 我会试试这个。希望它能起作用。 – Nashpaw 2010-08-21 12:06:31

+0

e.RowIndex 没有这样的属性RowIndex e – Nashpaw 2010-08-23 03:03:27

+0

我正在为选定索引更改事件编写此代码。 – Nashpaw 2010-08-23 03:04:32