Enable/disable RadSlidingPane from server code

4 posts, 0 answers
  1. Casey
    Casey avatar
    19 posts
    Member since:
    May 2011

    Posted 05 Apr 2012 Link to this post

    Is there a way to disable a sliding panel's tab from the server side? The "enabled" attribute on the RadSlidingPane does not seem to do the trick.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 06 Apr 2012 Link to this post

    Hi Casey,

    RadSplitter does not offer the required functionality, and with the current implementation of the control such customization is not a trivial task, thus it will require overwriting of several private client-side methods, which is highly not recommended. Nevertheless, you can use its Visible server-side property to toggle the sliding pane's visibility.

    Regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Casey
    Casey avatar
    19 posts
    Member since:
    May 2011

    Posted 06 Apr 2012 Link to this post

    I was trying to stay away from overwritting the client side methods, but I guess it cannot be avoided since this is one of the user requirements. I am not a JavaScript expert but I came up with a way to do this. I have the following function called on the window.onload event as well as the ClientEvents-OnResponseEnd of the RadAjax Panel which contains the Radslider.

    function DisableRadSlidingPane() {
        var enable = document.getElementById('<%= Me.hdnEnable.ClientID %>').value;
        var pnl = $find('<%= slPaneReportCriteria.ClientID%>');
        if (pnl != null)
            pnl._tabContainer.disabled = enable;
    }

    I am still having one small issue though. I was assuming that this function would fire upon raising a postback to the RadAjaxPanel that contails has the ClientEvents-OnResponseEnd="DisableRadSlidingPane()" but that is not happening. Do you know why this would be? And is there an alternative way of calling this function? You mention below/above that there are several methods that would require an override. Am I missing one?

    Thanks,
    Casey


  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 10 Apr 2012 Link to this post

    Hi Casey,

    The ClientEvents-OnResponseEnd property of RadAjaxPanel expects the name of the function that should be assigned as a handler to that event, e.g.:
        ClientEvents-OnResponseEnd="DisableRadSlidingPane"
    Please note the missing brackets after the name of the JavaScript function.

    In addition, the overwrites, that I mentioned in my previous reply, that need to be applied - several event handler need to be removed / reattached to the tabContainer in order to achieve the required result. For your convenience I have attached a sample page implementing the required functionality. Please note, that this is highly not recommended.

    On a side note, I brought this case the attention of the developers of RadSplitter and we will consider implementation of such functionality.

    All the best,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top