Move RadSplitterBar programmatically

4 posts, 0 answers
  1. LUDOVIC
    LUDOVIC avatar
    4 posts
    Member since:
    Sep 2012

    Posted 15 Nov 2012 Link to this post

    Hi

    I have the following structure :

    RadSplitter

        Pane1

        RadSplitterBar

        Pane2

    On the first load, pane1 is 100% and 0% for pane2 but on specific event I would like to change it to 50/50% for exemple.
    I don't find solution to achieve this client side or server side.

    Someone can help me

    Thank in advance

    Ludo
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2012 Link to this post

    Hello,

    I suppose you want to set the Height of RadPane programmatically. Following is the sample code that I tried to change the Height of RadPane onClick of a Button.

    ASPX:
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal">
        <telerik:RadPane ID="RadPane1" runat="server" Height="100%">
        </telerik:RadPane>
        <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Both">
        </telerik:RadSplitBar>
        <telerik:RadPane ID="RadPane2" runat="server" Height="0%">
        </telerik:RadPane>
    </telerik:RadSplitter>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" />

    C#:
    protected void Button1_Click(object sender, EventArgs e)
    {
        RadPane1.Height = Unit.Percentage(50);
        RadPane2.Height = Unit.Percentage(50);
    }

    Hope this helps.

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. LUDOVIC
    LUDOVIC avatar
    4 posts
    Member since:
    Sep 2012

    Posted 16 Nov 2012 Link to this post

    Thank you very much! It work fnie !!!

    pane2.set_width(500);

    but this allows me to resize to 500... px. how to do the same using pourcentage ?

    thank in advance

    regards

    Ludovic
  5. Vessy
    Admin
    Vessy avatar
    1385 posts

    Posted 20 Nov 2012 Link to this post

    Hi Ludovic,

    I am afraid to say that the width (and respectively the height) of a RadPane cannot be set in percentages from the Client. If you want to set the width in percentages (not in pixels) you will need to do it Server-side, following the above mentioned approach:
    protected void Button1_Click(object sender, EventArgs e)
    {
        RadPane1.Width = Unit.Percentage(30);
        RadPane2.Width = Unit.Percentage(70);
    }

    Regards,
    Vesi
    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