0

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.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by networkmancer
1

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

Votes + Comments
thanks
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.