RadContextMenu + Loading Panel

2 posts, 0 answers
  1. SamVanity
    SamVanity avatar
    154 posts
    Member since:
    Apr 2006

    Posted 08 Aug 2008 Link to this post


    I have a RadContextMenu that is defined dynamically on the client side for many controls on a page.

    When the context menu item posts back, I would like to show a loadingpanel on the context menu. I don't seem to be able to do this.

    If you have any suggestion, let me know.
  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 09 Aug 2008 Link to this post

    Hello Sam,

    You can not use the RadAjaxLoadingPanel control with the RadContextMenu control (without some complex JavaScript to enable/disable the loading panel and position it correctly). However, you can use the built-in LoadingStatusTemplate to get the same functionality. Simply add the same image you wanted to use in the RadAjaxLoadingPanel to the LoadingStatusTemplate and that image will display until the menu items are loaded. Here is a quick example:

    1 <telerik:RadContextMenu ID="RadContextMenu1" runat="server"
    2     <Targets> 
    3         <telerik:ContextMenuControlTarget ControlID="RadGrid1" /> 
    4     </Targets> 
    5     <DataBindings> 
    6         <telerik:RadMenuItemBinding TextField="Text" ValueField="Value"/> 
    7     </DataBindings> 
    8     <WebServiceSettings Method="GetMenuItems" Path="RadContextMenuService.asmx" /> 
    9     <Items> 
    10         <telerik:RadMenuItem Text="Menu" ExpandMode="WebService" /> 
    11     </Items> 
    12     <LoadingStatusTemplate> 
    13         <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
    14                 style="border: 0px;" /> 
    15     </LoadingStatusTemplate> 
    16 </telerik:RadContextMenu> 

    I hopet his helps. Please let me know if you have any further questions.

    Kevin Babcock
Back to Top