Skip to content

Datagridview data read

bdesh tiger

Asked Jun 8, 2009, 1:16 PM EDT1 answer
Share
LinkedInX
Hi all, I have very silly question.
 
To read data from gridview:
string lsvalue1 = datagridview1[0 , 0].Value.ToString();

it reads column1, row1 data from gridview. What the syntax if i want column0,selectedrow  data? for example  string lsvalue1 = datagridview1[0 , currentrow????command].Value.ToString();
Cheers
BT

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    dgw.SelectedRows[0].Cells[0].Value.ToString(), where "dgw" is your DataGridView component
    0