Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Help! ComboBox does not databind properly Collapse All
Subject Author Date
Leon Zhao Oct 9, 2007 - 10:58 PM

I’m trying to use the combo box with the data binding example from here:
http://www.akadia.com/services/dotnet_databinding.html

Basically the combo box would load data source, display member, and value member properly. The binding does not work:
After I added the line:
cb1.DataBindings.Add("SelectedValue", customersDataSet1, "Customers.Region");
The combo box shows the class name as text instead. When I select a different value, the change is not synced to databind datasource. Lastly, if I manually change the SelectedValue, it takes 10 seconds for the displayValue to update (e.g. I had a button clicked to set cb1.SelectedValue = "MA"; and the text changes to "Massachusetts" after about 10 seconds)

I really need to pick a good looking ribbon package that has a working databinding. DevExpress fails mierably, Telerik is basically a scam, SandRibbon works with binding but they have no other UI component (such as buttons), everything else is basically crap. ElegantUI is really as close as it gets, I hope I just missed something obvious to get data binding working.



Technical Support Oct 12, 2007 - 4:54 AM

We have just tested the case that you described. The problem occurs only when you are editing data in a DataGridView cell. But please noter that if you replace the Elegant UI combox box with the standard one, the problem remains the same. It seems that the problem is in DataGridView, which doesn’t commit data changes until the focused control changes. If you mean something different, please send us a test project that illustrates the issue.

Technical Support Oct 10, 2007 - 8:07 AM

One specific issue of ribbon UI is that a control (a combo box, for example) can be frequently moved from one parent container to some other (for example, in the case of collapsed ribbon groups). In this case, data bound controls are causing significant performance problems because the binding context changes frequently . Because such cases of complex data binding are not so common in real life, we decided to block binding context change notifications for the combo box by assigning its BindingContext to a stub instance. You can always turn off this behavior by setting the BindingContext value to null. For any cases when the parent of the combo box never changes, this solution will not affect performance. So just insert one line of code into your initialization method

cb1.BindingContext = null;
If it does not help, please let us know.

As for the 10-second delay after setting SelectedValue, we failed to reproduce this problem. So everything works fine here. However we would like to help you, so if the problem persists, please send us a sample project that illustrates this issue.

Please note that Windows Forms data binding implementation is not so good for real-world applications, many implicit problems can arise here. Of course, we try to do our best to support data binding for our components, but still we would recommend you use old-fashioned event-based property value synchronization techniques. For Windows Forms programming, this is simpler and better after all.

Leon Zhao Oct 11, 2007 - 10:29 PM

I’m dealing with a lot of combo boxes in my app, I think binding the data source to a static array member effectively reduce the work to keep each and every combo box / listbox updated to zero. I tried setting BindingContext to null, it works just fine except if the data source is updated by another control, the update event does not occur to ElegantUI combobox until another event (such as mouse over) occurs. This is not crucial to my application, but it’s not the behavior exhibited by standard windows combo box.