Not sure if I'm not understanding the concept of the toolbars manager.
I currently have some logic that triggers on my winform controls' Leave events e.g. for textboxes to trim their data. During routine testing I intentionally left some unformatted data on my control and clicked on the toolbar manager's button to save and exit.
However, apparently the control's Leave event was never triggered and so the logic never took place. Could someone explain if this is an oversight or an intentional feature of the ultratoolbarsmanager?
Hello borong,
I never thought of this. Thank you for sharing it, I am glad to hear that it helped.
Please feel free to let me know if a question about our tool set comes up on your mind.
Hello Boris:
Some slight misunderstanding...I need to execute the validation itself upon the statebutton's click (I'm guessing the example you're putting as '3==3'), which takes a significant amount of time, about a sec. I also need it to be cancellable as I want to try to avoid all the other events that occur as part of the chain (MouseUp, ToolClick, AfterElementLeave etc), including the check-change of the statebutton group I click on, so I'm hoping for a cancellable eventargs.
However, most of the alternatives with cancellable events take place on Activation or MouseEnter, which places an unnatural lag upon merely brushing against the buttons. This was the problem I faced.
I think I found a feasible alternative: as per suggested elsewhere, I let the click event fall through and execute my validation there. However I found out that if it fails I can use the previously-checked statebutton's InitCheckedChanged event to flip the checkstate back on while avoiding the triggering of even more events after. So far it seems to work well, I'm going with this solution.
What you could do is to handle the 'MouseEnterElement' event and do something like this:
private void ultraToolbarsManager1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (e.Element.GetContext() is ToolBase) { if (3 == 3) { isValid = true; } else { isValid = false; } } }
Then, depending on the state of the 'isValid' variable, you will or will not execute your code in the click event.
Please let me know if this solution does not work for you or if I misunderstood you in some way - I will log a new product idea for you.
I will be waiting for your feedback!
Sorry for the late reply.
I haven't really found a solution to this yet beyond a weak workaround: basically the problem has been raised in different forms elsewhere in this forum: I'm just trying to execute validation of a current 'page' before moving to another page via statebutton activations.
My ideal scenario would be for the user to click another statebutton, trigger the validation, then cancel the button click if the validation fails, similar to .NET's various 'BeforeXXXX' events.
However there aren't any such events I can see beyond the 'BeforeToolActivate' event which triggers by mere mouse-overs.
I know there aren't really any solutions to this so far, but could this event be somehow added in a future release?
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.