Posted
on Apr 22, 2011
(permalink)
It would be nice if the Menu Item scaled in size until it reached the set GroupSettings.Height then the size was fixed to the set height value and then scrolling was activated. I'm try to do this programatically with dynamic data and need a bit of help ...
I have a menu such as ...
<Telerik:RadContextMenu id="ScoreMenu" runat="server" OnClientItemPopulating="scoreMenuItemPopulating"
EnableRoundedCorners="true" EnableShadows="true">
<WebServiceSettings Path="~/WebServices/wsClasses.asmx" Method="GetScoreMenuItems" />
<LoadingStatusTemplate>
Loading...
</LoadingStatusTemplate>
</Telerik:RadContextMenu>
The RadMenuItems of the root menu are dynamic based on data and are constructed using ...
myRootMenuItem.ExpandMode = MenuItemExpandMode.WebService
This in turn calls a webservice that creates a child menu to myRootMenuItem which can have varying amounts of menuItems based on data.
Somehow once my webservice is called and the child menu is created I would like to see if the number of child menu items for the new node is greater than 'x' number. If so I would like to then set the GroupSettings.Height for myRootMenuItem so I can fix the height and enable scrolling. If I hard code a height of 150px and only have 1 item it looks silly. If I have 50 menu items and don't have the height set it's unusable from the users perspective.
What's the best approach to do this?
Thanks,
Scott