G
Guest
I have a problem with controls (several combobox and textbox controls) placed on the TabPages of a TabControl. The controls on the first TabPage display the data from the dataset, but a null dataset is returned from GetChanges when attempting to update. On the other tabpages, no data is displayed in the controls from the dataset, although the dataset contains the right information. All controls were bound (at design time at least) to one table in the dataset
From the reading I have done so far, it seems that container controls such as TabPage and Panel will create their own BindingContext by default. I have seen posts that suggest the BindingContext iof each TabPage should be set to the BindingContext of the Form, but others also suggesting that the BindingContext of the TabPage may change as you switch tabs, but no real explanation of how to overcome this. I have tried setting BindingContext of the TabPages but no success
I would have expected some doc on MSDN describing this, as it seems quite complex (IMHO) and not too out of the ordinary. Is there any example code out there of how to do databinding on tabpages? I assume the same applies to panels but can't find any help there either
Thanks
Scot
Member of the Microsoft Empower Program (ie newbie to C#)
From the reading I have done so far, it seems that container controls such as TabPage and Panel will create their own BindingContext by default. I have seen posts that suggest the BindingContext iof each TabPage should be set to the BindingContext of the Form, but others also suggesting that the BindingContext of the TabPage may change as you switch tabs, but no real explanation of how to overcome this. I have tried setting BindingContext of the TabPages but no success
I would have expected some doc on MSDN describing this, as it seems quite complex (IMHO) and not too out of the ordinary. Is there any example code out there of how to do databinding on tabpages? I assume the same applies to panels but can't find any help there either
Thanks
Scot
Member of the Microsoft Empower Program (ie newbie to C#)
. The form allows users to update options, and all these options are pulled from a single row in the database. I am calling EndCurrentEdit() but I will check that I have the specified the correct datasource and datamember. To be honest I only mentioned this because I wondered if the problems were related. If I can get data showing up on the other tabpages I think I'll be able to get the changes working on my own. I will test with additional rows and play around with EndCurrentEdit() and let you know