Quote:
Originally posted by VB.NETNEWBIE
Hi,
I have a datagird in windows form, how I get the value from the column when user click then row.
For example, a datagrid contains the following column
productid,productname,productdesc
if a user clicks a row, it should return the productid of that row.
How could I do it?
Thanks,
Newbie
VB Code:
'lets assume that you have a datatable and you bind it to your datagrid and your datatable has 3 columns productid,productname,productdesc
'in the datagrid click event
datatable1.Rows(DataGrid1.CurrentCell.RowNumber)(0)---it gets the first column of your datatable (productid)