Search code examples
telerikradajaxmanagertelerik-ajaxradtreelist

RadAjaxManager won't allow me to Rebind my RadTreeList


I am using a RadTreeList to display items, a RadContextMenu (Insert, Update, Delete) for when right clicking on a Tree Item and a RadWindowManager to help open a popup window on RadContextMenu ItemClick. When they click Insert or Update a dialog window opens smoothly they save, the dialog closes, treelist rebinds perfectly. When they click Delete I do not need to open a Window just run the code for deleting and then RadTreeList.Rebind();

Rebind will not work because of this item in my RadAjaxManager. The reason it is in here is so the dialogs open smoothly when the context menu is clicked.

The Ajax Setting messing things up, but also making my popups open smoothly:

<telerik:AjaxSetting AjaxControlID="rcMenu">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
    </UpdatedControls>
</telerik:AjaxSetting>

Here is how I have my Context Menu setup:

<telerik:RadContextMenu ID="rcMenu" runat="server" OnItemClick="rcMenu_ItemClick" EnableRoundedCorners="true" EnableShadows="true">
                <Items>
                    <telerik:RadMenuItem Text="Insert" Value="Insert"></telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Modify" Value="Edit"></telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Delete" Value="Delete"></telerik:RadMenuItem>
               </Items>
</telerik:RadContextMenu>

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" VisibleOnPageLoad="true" EnableViewState="false">
    </telerik:RadWindowManager>

Does anyone know of any workarounds so I can get the smooth dialog openings for Insert and Update, and for delete the page will still rebind the treelist when I call RadTreeList.Rebind();?


Solution

  • Please try with the below code snippet.

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rcMenu">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadTreeList" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="rcMenu" LoadingPanelID="RadAjaxLoadingPanel1" /> <%--Please remove this if not necessory--%>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    

    Let me know if any concern.