retrieving data from datagrid to textboxes

jaya

Member
Joined
May 5, 2005
Messages
15
Programming Experience
Beginner
hello,
i have one datagrid in my form with multiple rows.
now i want to select one row in the grid and i want to display the details in textboxes.

ex. say if i have 5 columns and i have 5 textboxes.
now when i select one row in a grid , i want to display that details in corresponding textboxes.

byee
 
Hello what I have done in the past is a databind to the text boxes during an click event for the data grid:

TextBox.DataBindings.Add("Text", DataSet, "(database table from the dataset).column")

The first parm is TEXT, but if it was like a date time picker it would be VALUE, if it was a checkbox then it would be CHECKED.


I hope that helps, in many examples I have seen this but after I clicked on another row my program crashed so after each time I bound to the Textbox or whatever I did a:

TextBox.DataBindings.Clear()

I am not sure why maybe some one else can add that in.
 
Back
Top