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..

use adodc control then bind the textboxes to their desired field.so everytime you switch rows it also switches in the textboxes.

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.

oh.. okay.. thanks :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.