raising events in forms

raising events in forms

Old forum URL: forums.lhotka.net/forums/t/3564.aspx


jhw posted on Tuesday, September 18, 2007

Simple example:

City control with a combobox of provinces from which to pick. The required province is not there so we have to go to the province form and add it. Now I want the city control combobox to be automatically updated.

The obvious way is to have the editable province list raise an event that the city control catches, and update the combobox binding source.

But Rocky does not recommend this, even though there is a do not serialize attribute you can add to the event so that the control won't be serialized during saving of the editible list.

The other soluntion I see is to create a new non-csla object containing a province list changed event. Declare the class globally. Manually raise the list changed event in the province control, and catch this event in the city control.

Is this the best way to do it? Is is better just to use the non-bindable attribute?

While this is a simple example and it would be easy just to close and reopen the city control.
But in more complex situations, this does not make the user happySad [:(]

 

Heath

Copyright (c) Marimer LLC