Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User Control - Setting BindingSource
Message
From
02/12/2004 18:09:58
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00966165
Message ID:
00966553
Views:
7
Scott,

What you're looking for, I think, is to make the call to RegisterBoundControl from formA, passing a reference to each control on User Control 2 needing binding. Depending on how we've needed this to work, we've either hard-coded the binding properties directly on the control, or we've created a method on the control itself, with the various property values as parameters.

Now, as far the ComboBox not showing the correct column when you drop it directly on the form...

Other than re-checking to be sure that you've entered the correct field in the BindingSourceDisplayMember, and that the lookup indeed contains that field in the datatable/dataview, you may want to step through the binding.

Take a look at mmBindingStrategy.cs (in Windows Forms solution) and specifically at the BindingStrategyList object. Depending on which option you're using (dataview vs. datatable), you'll want to find the matching overload of BindData(). The first time you debug, it'll be fairly convoluted, but it's definitely worth the time to learn what's happening and you should have a "Eureka!" moment somewhere in there to replace the Larry Fine ones you've been experiencing.

Hope that gets you on the path,
---J


>Where do I call RegisterBoundControl? From the form (FormA)? I do not have that option on any of the user controls (because they are user controls).
>
>I backed up a little bit and got rid of User Control 2 and just placed a simple mmUltraCombo on User Control 1 just to test.
>
>This combo uses a business object to get its data and the usercontrol and main form use a second business object for its data. When i select a record in the datagrid I want the corresponding record looked up in the combo.
>
>I have set all the binding properties on the combo (BindingSource, BindingSourceDisplayMember, BindingSourceValueMember from the businessobject that populates the combo...AND BindingValueSource, BindingValueSourceMember from the business object teh populates the form and usercontrol) and it does indeed change when I select a record in the Datagrid. HOWEVER, it does not show the correct column and I cannot find a way to change it.
>
>I have a lot of hair, and i am about bald pulling it all out. :-)
>
>Any ideas? I figure that if I can get this working, I'll save what's left of my hair and be able to apply it to the second user control.
>
>Thanks...
>
>Scott
Previous
Reply
Map
View

Click here to load this message in the networking platform