Hello,
i use the WebDataMenu with a WebHierarchicalDataSource. On a Click of an Menu-Item, i use the Navigate-Url to sent a Query-String to the same page and load different content. But on each Postback, not only the content also the Menu is loaded. So How can i expand the Menu to some level and select a Node in code behind?
thanks,
Patric
Ok, i changed my page so there is a content area and the WebDataMenu. I now catch the 'Item-Click' in codebehind and load with a Ado.Net Datareader some Data and bind it to the content area.
I changed the behavior of the WebDataMenu so it expand automatical on Hover and 'CloseMenuOnClick' = False. But if the page load some new data in the content area, no menu item is selected or expanded.
What is my error??
Hello page,
Thank you for posting in the community.
Your WebDataMenu is most likely being reloaded due to the query string changes themselves (it is interpreting it as an entirely new URL). Using an Application variable however, you can persist the selection by handling the ItemSelected and DataBound events. For instance:
Please let me know if this helps.
Thank you for your reply.
I am still researching the matter, however it seems that handling item click in this scenario may not be possible due to the navigation occurring when clicking on an item. As for having the menu expanded after postback I am unsure that this behavior is supported by the WebDataMenu (a WebDataTree or WebExplorerBar may be more suited for this task). I will continue my research on this topics and provide you with any information available.
Hello Petar,
i use the WebDataMenu on the bottom part of a page and the different Menu-Items open from left to right (each time only one part). So i don't think this is possible with the WebExploreBar. May be with the Tree. But the strange behavior is: if i started with the control, i used a item-click to expand the menu and i can catch the click event on client side and the menu stay expanded. (i only used the code behind because a an ado.net dataReader was easier for me to handle; use the value of the clicked menu item, to load the data). Now if i use the default 'expand'-event (mouse hover) the menu close immeditely, if the mouse went out (that's correct but i see no way to let it expanded via code behind).
hope you find some answer soon, because it is for a running project.
Thanks
Hello Patric,
Thank you for your reply and feedback.
I am still working on this matter and will keep you posted of my progress.
Apologies for the delayed response.
I am attaching a sample illustrating how the menu may be opened after a postback to the currently selected item (with the querystring changing). Note, however that submenus would be closed after unhovering the menu (this is due to the control's design).
Please feel free to contact me if I may be of assistance.
thanks for your sample, it point me in the right direction. It works part-time, because i use the click event, after the second click the menu don't expand. The solution for me is a client and server side code, that i explained on my other post: http://es.infragistics.com/community/forums/t/71778.aspx
The problem is the caching of some 'Menu-Structure' so the 'item-selected'-collection freezed the sub-menu. You can see my working solution on http://www.sternenweg.net/detailseite.aspx. The item 'sternenweg' shows the problem area. I must rebind the data on the server, to destroy the client cache.
Your code with the 'get_selectedItem() != null' on the client side Init-Event was the key.
Thanks for the help
Hi Patric,
Please feel free to contact me if I can be of further assistnace.