I have an UltraCombo on a form. I have created a binding source for the class of objects I want to display, and have set the datasource on the ultraCombo to my binding source. I have defined the ValueMember and the DisplayMember.
At run time I add items to my binding source, and finally try to set the initially selected item. I set the Value property of my ultraCombo, but the corresponding item does not display in the combo box UNTIL the user drops it down. At that point it is clear that the correct item is selected in the dropped down list, and if the user closes the drop down list by clicking somewhere else on the form, the combo box shows the correct item. The behavior is the same if I try setting the SelectedRow property instead of the Value property.
What do I need to do to see the initially selected item?
Further discovery: I was using an UltraCalcManager to concatenate two string columns to create the value for the computed DisplayMember column.
When I use a regular property-backed column for the DisplayMember everything works as expected. I speculate that the ultraCalcManager is not creating the strings until too late. The computed column is hidden, and only used for display when the combo box is not dropped down. What voodoo should I invoke to make the ultraCalcManager do it job on initial population?
Hi,
That sound like a reasonable theory and you are probably right. UltraCalcManager is probably not a good way to do this. By default, the UltraCalcManager performs calculations asynchronously.
You could set the UltraCalcManager's CalcFrequency to synchronous, but that will affect the entire calculation network, but just your UltraCombo.
Also, there's another property on the UltraCalcManager called DeferredCalculationsEnabled. This contorl whether the CalcManager tries to optimize it's calculations by calculating visible rows in a grid or dropdown first.
I recommend that you use the UltraCombo's InitializeRow event to concatenate your strings and populate your DisplayMember field instead of using a formula.
I just wrote a little wrapper object that precomputes the string concatenation. This gets rid of the calc manager entirely, and makes it crystal clear when and how that computed field is generated. All is working well now.