2017-08-30 61 views
1

獲取特定行和特定列的值,這是做這項工作的GridView控件,但在DataGrid中從數據網格

Dim x as string = GridView1.rows(e.rowindex).cells(2).text (Working)  
Dim x as string = DataGrid1.rows(e.rowindex).cells(2).text (Not Working) 

不工作,我需要使用DataGrid工作的代碼。

回答

0

試試看看它是否適合你。

Dim x = DataGrid1.Rows(e.rowindex).Cells(2).Value.ToString() 
+0

我嘗試過了,也沒有工作 但我有別的工作 「DIM x作爲字符串= e.item.cells(2)的.text」 –