This works, but is it optimal?

2 posts, 1 answers
  1. Boris
    Boris avatar
    289 posts
    Member since:
    Oct 2012

    Posted 15 Jan 2013 Link to this post

    As usual I'm on a deadline and tinkering with aspects of Telerik I don't fully understand.  
    I've been looking at your splitter demo (

    I have a form with regions divided up by splitters.  

    Like your demo I need to be able to expand and collapse the end pane in Javascript, depending on the value set in a combobox.  

    Unlike your demo, the page is supposed to start off with the endpane collapsed.  The toggle in my checkForValue function when the pane is initially collapsed,  initially didn't work.  

    To fix this, on the server side, in the Page_Load event, to initially expand the pane, I put:
     RadPaneEnd.Width = new System.Web.UI.WebControls.Unit("55%");

    On the client side, I put this, to fire on load, and collapse the pane:
      $(document).ready(function () {        
                var splitter = $find("<%=RadSplitter1.ClientID%>");
                var endPane = splitter.getEndPane();

    The expand/collapse function itself is:
      function checkForValue(sender, args) {
         var splitter = $find("<%=RadSplitter1.ClientID%>");
         var endPane = splitter.getEndPane();
         var curVal = sender.get_text();
         if (curVal == 'Value1') {
         else {

  2. Answer
    Vessy avatar
    1893 posts

    Posted 18 Jan 2013 Link to this post

    Hi Boris,

    I tried to reproduce the described scenario and everything behaves well on my side. The provided functions seem to be configured correctly.

    For your convenience I am attaching my test project - I attached the checkForValue() function as a handler to the RadCombobox's OnClientSelectedIndexChanged event.

    I hope this was helpful for you. Feel free to contact us if we could be of any further assistance.

    Kind regards,
    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