How can I obtain the first row value. ex.
Table
ID NAME AGE
1 peter 14
2 Jogn 13
3 Luke 6
If i click peter I will get 1.
I can get the clicked value but I do not know how to get the first item in the selected row.
How can I obtain the first row value. ex.
Table
ID NAME AGE
1 peter 14
2 Jogn 13
3 Luke 6
If i click peter I will get 1.
I can get the clicked value but I do not know how to get the first item in the selected row.
ok try this
'place this code at the click event of your grid , but please make sure that the selection property is set to the full row select.
txtid.text = datagridview.item("columnname/Index",datagridview.currentrow.index).value.tostring() 'if you give the column name then use "" if you want to give index then dont use them.
If this code solve your prob . please mark your thread solved and vote me up :)
Regards
Thankss.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.