Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

click on a row of a datagrid

Status
Not open for further replies.

jasperjasper

Programmer
Mar 23, 2004
117
US
Hi
I have received great help here. I have a loaded datagrid that i want to click on the current row of the grid and see those values in the text boxes on the form. Is there a clean way to do this.,..
 
Have you looked at the code-behind generator when you choose your datagrid...then select the click action...you'll probably have to grab the index clicked on and then grab the values from the datagrid based off of the index clicked.
 
Try something like this...

Dim dr As DataRow

dr = myDataSet.Tables("myTableName").Rows(myDataGrid.CurrentRowIndex)

textbox1.text = dr.Item("columnName").toString
 
Thank you. Works perfectly. Where does one learn these techniques...Microsoft does not include them in any docs with .NET
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top