This is a migrated thread and some comments may be shown as answers.

Enable/disable RadSlidingPane from server code

3 Answers 35 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Casey
Top achievements
Rank 1
Casey asked on 05 Apr 2012, 10:35 PM
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.

3 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 06 Apr 2012, 11:45 AM
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.
0
Casey
Top achievements
Rank 1
answered on 06 Apr 2012, 08:33 PM
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


0
Dobromir
Telerik team
answered on 10 Apr 2012, 01:15 PM
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.
Tags
Splitter
Asked by
Casey
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Casey
Top achievements
Rank 1
Share this question
or