another databinding :)

If youre saying that one textbox is only used for searching and the other 3 are only to display fields from the grid, then you should only have to add the DataBindings to the three textboxes one time, preferrably when the form loads (after youve created your DataSet/DataTable).

If you really need to rebind the textboxes after each search, then youll have to call Textbox.DataBindings.Clear() before adding the binding back in as you cant bind the same property more than once. You should ONLY have to do this if:
A. Your textboxes will switch between bound and unbound mode - maybe if theyre in "enter params and search" mode and then theyre in bound mode after the search.
B. Your DataSet variable changes to be a new DataSet. In that case, your textboxes will be bound to the "old" DataSet while the DataSet variable points to a new DataSet. I cant think of why youd want to re-set your DataSet variable to a new instance of a DataSet, but who knows.

-Nerseus
 
no, all 4 textboxes get bound after i click on the grid, but its good to know that i have to clear the bindings whenever i click on the grid
 
Back
Top