-
DataGrid
Assuming this is my DataGrid and its record.
===========================
|StudNo | StudName |
===========================
|001 | MeeJee Joi |
------------------------------------------------
|002 | Gou Li |
------------------------------------------------
|003 | William Ho |
------------------------------------------------
I tried: MessageBox.Show(DataGrid1.Columns(0).Text), but this code doesn't work.
Please help me, I want to show the StudNo 001 using MessageBox!
-
Get the data from the datasource not directly from the datagrid. The datagrid really only shows the data that it is bound to, but the actual data is still mainly in the source.
-
I agree with Edneeis, but if you still want to get the item from the grid you might try
MessageBox.Show(DataGrid1.Item(0, 0))