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

RadPane Width in Percent

1 Answer 215 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
adam
Top achievements
Rank 1
adam asked on 09 Apr 2008, 05:44 PM
How can I get back the Width of a RadPane in Percent after a postback?

I am creating the Splitters and Panes dynamically, and on the creation of the Panes, I am specifying their widths in percentages. I have a postback LinkButton that will persist the state of the splitters and panes - but when I access the Width of the panes, they are all specified in pixels -- not percentages.

I checked with firebug, and the width in pixels that is being returned matches the width of the pane in the browser, but I want the width to be in percent not pixels.

Thanks,
Adam

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 16 Apr 2008, 08:48 AM
Hello Adam,

You can take the initially pre-set sizes of RadSplitter and RadPane's controls but if you change them and want to take the new set values you should use a formula which calculates them, based on the pixels sizes.

As to taking the initial size settings in percentages:
  1. RadSplitter has the following two properties:
   var splitter = $find("<%=RadSplitter1.ClientID %>");  
   alert(splitter._originalWidth);  
   alert(splitter._originalHeight); 

    2.   RadPane can change only one of its sizes - if it is in a horizontal RadSplitter, its width is a constant and is equal to the RadSplitter's width and only its height is variable. When you have a vertical RadSplitter the height is a constant and the width is a variable. This being said you need to take only this variable size and it can be taken with the following method:

var pane =  $find("<%=RadPane1.ClientID %>");  
alert(pane._getOrigVarSize()); 


Greetings,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Splitter
Asked by
adam
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or