how can i pass or put a row of data on a datagrid into a bunch of textboxes?

on my datagrid are StudentID, LastName and FirstName, i have textboxes named txtID, txtLname and txtFname, i have command buttons named cmdEdit and cmdSave

if i select an entire row and click the cmdEdit button, the data from StudentID, LastName and FirstName will be displayed on the textboxes and i can edit whats on it..

and then if i click the save button.. the data that i edited will be saved and can be seen in the datagrid.

i have something in my mind on how to do it but i dont know what codes to use..

ive used data environment instead of adodc and yeah, everytime i switch data from the data grid, the textbox also changes

but what if i want to select an entire row, press the edit button, the data from the data grid will put to the textbox, then ill press the save button to save my changes or clear the entire textboxes if suddenly my mind changes and i dont want t o edit what's on the data grid?

ive used data environment instead of adodc and yeah, everytime i switch data from the data grid, the textbox also changes

but what if i want to select an entire row, press the edit button, the data from the data grid will put to the textbox, then ill press the save button to save my changes or clear the entire textboxes if suddenly my mind changes and i dont want t o edit what's on the data grid?

you can't get data directly from datagrid.
you must get row number from datagrid and move in adodc then show record in textbox.

This article has been dead for over six months. Start a new discussion instead.