How would I get the actively or just clicked menu item on the server.
From the MenuItemClicked event, it is easy to check the WebMenuItemEventArgs.Item property. However, I need to get it from a different event.
In my case, its when a UltraWebGrid RowBatch event has fired. In certain cases we want the rowbatch event to abort. For instance, if the user clicks File->Cancel in the UltraWebMenu, the RowBatch events will fire and we want to check to see which Item was selected so we can abort the process.
How can I get the currently selected item in the UltraWebMenu.
I tried setting it from the clientside events and storing it in a hidden field. But the hidden field isn't getting the value I assign it before the grids RowBatch events are fired.
If I could just access the selected item in the UltraWebMenu???
Hello,
You can take a look at this link:
http://forums.infragistics.com/forums/p/10884/41864.aspx#41864
Hope this helps.
Sadly, we couldn't use the rowbatch events because we couldn't figure out a way to prevent them from processing the grid changes on every single postback. Our applications have a lot of functionality and many of the postbacks shouldn't be applying grid changes.
I wasn't working on this personally, but another developer ended up creating another hidden column that acted like Grid Rows DataChanged property and added clientside code to set this column. He then looped on the grid to read this column (only when user is saving). Hardly ideal, but its what he ended up having to do. Not sure if he could of just used the DataChanged property or not (maybe its readonly). Either way they worked around the issue with a hack of sorts.
I appreciate the suggestions...
Yes, this indeed is a hack, but I believe it is a good solution. PostBack event handlers fire always after Page_Load and this is when the selected item on server actually changes, so it is hard to sync that with other page lifecycle events like grid binding (which typically occurs earlier in the cycle).
So I really like your approach. I can probably suggest something similar to what you have implemented - the idea is from another client of ours (we have a great community) and for another product, but I believe same principles may apply here as well.
Oscar's idea is to handle the CSOM before click event and store the item in a hidden variable, which is then immediately available and correct in each event of the page lifecyle, not only after Page_Load.
You can find Oscar's solution and some sample code here:
http://forums.infragistics.com/forums/t/11288.aspx