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

Move RadSplitterBar programmatically

3 Answers 95 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
LUDOVIC
Top achievements
Rank 1
LUDOVIC asked on 15 Nov 2012, 03:01 PM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Nov 2012, 08:52 AM
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.
0
LUDOVIC
Top achievements
Rank 1
answered on 16 Nov 2012, 01:26 PM
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
0
Vessy
Telerik team
answered on 20 Nov 2012, 02:46 PM
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.
Tags
Splitter
Asked by
LUDOVIC
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
LUDOVIC
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or