PDA

Click to See Complete Forum and Search --> : DataGrid


martialdc
Dec 6th, 2002, 01:27 AM
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!

Edneeis
Dec 6th, 2002, 01:49 AM
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.

Athley
Dec 6th, 2002, 02:34 AM
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))