Hello,
we derived the checkbox and i want to add a sub like SetCheckStateSilent for setting the CheckState without fireing any event. Therefor i want to override the OnCheckStateChanged but it is not overridable. Why?
Is it possible to set the value without fireing the CheckValueChanged nor Validated event? The Validated event fires but not through the OnValidated-method.
Thank you,
Bjoern
Hi Bjoern,
I just took a look and this looks like a bug to me. The OnCheckStateChanged is not virtual, so you cannot override it and prevent the event from firing.
You can, of course, unhook the event listeners, but that only works if you happen to be in control of those listeners, so that's not an ideal solution. I am going to ask Infragistics Developer Support to create a case for you and write this up for developer review and hopefully, the OnCheckStateChanged can be made virtual in a future release.
Regarding OnValidated, I'm not sure what you are referring to. This event is not an event defined by UltraCheckEditor, it's an event on Control, so it's part of the DotNet framework. Under what circumstances does this event fire outside of the OnValidated method?
Hello Mike,
the Validated-Event is fired without calling the OnValidated-method before. Normally you call the OnValidated-method which calls base method and so on until the real base calls raise event. But when i override the OnValidated method the part will never be called. So something is not right in the derivation.
I understand what you wrote here, but I am unable to find any situation in which the Validated event fires outside of the OnValidated method.
Can you provide a sample in which this occurs?
then i try it again. An event is raised by the object when calling "RaiseEvent xyz". But this line you should not call in a normal method. You should call it in the overridable OnXyz method and in any case you want to call the event you have to call the OnXyz instead of RaiseEvent xyz. To manipulate the events in derived classes you can override the OnXyz to execute code before or after the events is raised.
But in the case of your checkbox the event apparently is fired by RaiseEvent in a method which is not the OnValidated method. So nobody can execute code before or after the event. After the event is only possible when you handle the event itself.
Regards,
Hi,
I'm sorry, but I do not understand what you are describing.