How to enable scrolling for dynamically added submenu items for RadContextMenu

1 posts, 0 answers
  1. Bryan
    Bryan avatar
    8 posts
    Member since:
    May 2016

    Posted 19 May 2016 Link to this post

    Is there a way to add scrolling for dynamically added items to the sub menu? I've got many items loaded from ajax calls and dynamically added to the sub menu of my RadContextmenu on a RadGrid. Currently they are expanding beyond the boundaries of the viewport w/o any means to scroll to the bottom of them...

    Here is my front end menu settings:

    <telerik:RadContextMenu ID="contextMenu" runat="server" OnItemClick="contextMenu_ItemClick" OnClientItemClicking="onClientClicking" OnClientMouseOver="sb233loadtasks" 
        Skin="Metro"   EnableScreenBoundaryDetection="true" EnableAutoScroll="true" EnableRootItemScroll="true" DefaultGroupSettings-Height="500"  AutoScrollMinimumHeight="500" />


    Below is JS to load and add the dynamic items to the sub menu:

    function sb233loadtasks(menu, args)
                var item=args.get_item();
    // check if the target item is hovered over
                if (item.get_text().toLowerCase() == 'load task') {
                    var icol = item.get_items(),timestamp=new Date().getTime();
    // show loading
                // remove items loaded from last time   
                    for (var i = icol.get_count()-1 ; i >0 ; i--)
                 // load the data from ajax call ...
                                    var tasks = JSON.parse(data);
                                    if (tasks instanceof Array && tasks.length) {
                                        tasks.forEach(function (e) {
                          //add the item
                                                var sbsb = new Telerik.Web.UI.RadMenuItem();


    And adding conditionally other root items and the "load task" item to contain the sub menu in the back end, triggered upon page_load:

    protected void SetupContextMenu(string ProjectID)
        //Conditionally adding other static menu items...
         //Adding the item to contain the sub menu upon certain conditions
        RadMenuItem iETask = new RadMenuItem("Edit Task");
        iETask.Items.Add(new RadMenuItem(Utilities.Constants.loadingmsg));


    I tried to set the default height both in the back end and on the menu tag, as well as disabling animations, removing autoscroll handler upon menu closure etc, per suggestions from other threads, so far all to no avail...

    Any ideas?


Back to Top