Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1878
UltraComboEditor does not update in UltraTree
posted

I'm not sure if this is a bug but at least it seems for me to be one.

The problem occurs in a big application but I could reduce it to a tiny sample where this occurs as well. Pls don't ask about the sense of this application since it is only mirroring the behavior of the real application.

The application consists of a main form that will be started upon application startup. In this form there is an UltraComboEditor showing persons that are taken out of a list of Person objects using databinding with a binding source. There is a second form that has an UltraTree in it which shows the person's data with an UltraTree using the OutlookExpress style so it will look like the properties view in Visual Studio. There are three properties shown for the person: first name, last name and the gender. The gender is shown using an UltraComboEditor where the value could be selected out of a list (female, male). The properties dialog hooks on the SelectionChanged event of the UltraComboEditor in the main dialog so whenever another person is selected there the properties will be shown in the UltraTree. This works all perfectly fine with one exception. As soon as I select another gender using the combo in the UltraTree and select another person in the main dialog, the gender won't update anymore. The cells for first and last name still work fine! It does update as soon as I move away the focus from the gender combo e.g. to another cell. I tried to move away the focus from that cell by programatically select the node for first name but that didn't help. I placed a button onto the properties form and in the event handler for the gender selection changed event I set the focus onto that button and this helps. It seems that there is a problem when setting the value of a cell with underlying UltraComboEditor when this cell (or the entire UltraTree) has the focus.

Although the example isn't too big I don't want to put the source code in this posting but I've attached the entire solution as a ZIP-file to this post (hope that works).

If you remove the comment in method 'OnGenderSelected' so that method Focus on the OK-Button is called this is the workaround.

Kind regards, Wolfgang

Parents
  • 469350
    Offline posted

    Hi Wolfgang,

    If the binding just stops responding after a certain series of actions, then in my experience it usually means that an exception occurring in the binding and it was caught somewhere do you didn't see it.

    Try setting the Visual Studio IDE to break on all run-time exceptions and try to reproduce the issue. I'm betting that if you do that, you will see the exception occur and that will probably give some clue about what's going wrong.

    My guess is that there's a problem with the data types. The combo's value is probably returning a data type that the underlying data source cannot handle. I've also seen this same kind of thing happen if you try to write a Null into a field that does not allow nulls. The latter is probably not an issue here, since there's no null gender.

Reply Children