Hello,
I have a tree with some node cells set up with ultracheckeditors. I notice that the CellValueChangedEvent fires when checking off the editor but does not fire when setting the value programmatically. I've tried several permutations of setting the value mixed with different Enter/Exit edit mode calls (cell,row) but so far nothing seems to get the event to fire. The cell value is being set programmatically within a ToolClick event handler.
NetAdvantage 2009.2
thanks for any help.
Hi,
For some reason I hadn't received the email alerting me to his response earlier... In any case we found a way around this issue.
thanks
I just wanted to know if you were able to solve your issue based on Mike's suggestions or you still need help? Just let me know.
Thank you.
There's something of a gray area here. As far as I am aware, there's no hard and fast rule about whether events fire when you do something in code (as opposed to operations performed by the user). Some events fire and some don't.
The purpose of an event is to notify you, the programmer, that the user did something which you could not otherwise detect. So, in theory, if you are setting a value programmaticaly, you know you did it and you therefore do not need an event to tell you that it happened.
In a case like this, what I would do is take the code that runs inside the CellValueChanged event handler and move it into a helper method. Then you can call that method from the CellValueChanged event and also call the same method any time you set the value of a cell in code.
I've managed to get the event to fire by setting the ActiveCell to BeginEdit which seems to change state of the EditorResolved object (which is a checkeditor). By changing the Value of the underlying CheckEditor (made available via EditorResolved) causes the event to fire. This seems a somewhat round about way to trigger the CellValueChangedEvent. Is there a better or recommended way of doing this?