Problem In data Binding

shakir

Member
Joined
Dec 22, 2006
Messages
6
Programming Experience
Beginner
I ve problem..:(..We r developing a software in which we have to show data from two table in datagrid , we have did this task ,but the problem :eek:that we r facing :confused: is that we also have to show same data on textboxes...but when we click on datagrid row then no data binding was occur in textbox:( ......
Thanx.....
 
Both datagrids and textboxes need to be bound through the same binding context. In .NET 2.0 we do this byu using the same BindingSource, but .NET 1.1 doesnt have that. Perhaps another member who better nknows .NET 1.1 will be able to help
 
Use the same datasource....

I have a Grid and textboxes on a form. When a name is selected from the grid, the textboxes then show all the information regarding that user.

I.E.

Datagrid

DataSource: dsEmployees.
DataMember: EmployeeInformation

This then shows all employees in the EmployeeInformation table in the dsEmployees dataSet.

Textboxes

txtEmployeeName: (coded at runtime) me.txtEmployeeName.databindings.add("Text", dsEmployees, "EmployeeInformation.FullName")

txtJobTitle: (coded at runtime)
me.txtJobTitle.databindings.add("Text", dsEmployees, "EmployeeInformation.JobTitle")


As I highlight each row in the grid, the name and job title in the text boxes change accordingly.

regards,
Luke

(This is in my 1.1 application, I'm now upgrading all my apps to 2.0)
 
Back
Top