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

Saving Splitter dimensions per user

1 Answer 39 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Felix
Top achievements
Rank 1
Felix asked on 15 Mar 2010, 09:38 PM

Hello,

I finally managed to get my splitter set-up with two nested splitters containing a treeview and grids occupy 100% of the screens height and width. Unfortunately I'd like to save the dimensions of the four panes on a per user setting and this is not working properly.

Based on my setup I've four panes for which I persist the actual dimension on every onPreRender event. But after I reload the dimensions (in px) on a postback or ajax-call, the splitter does not resize itself anymore on a browser resize.

I assume it would be better to safe/restore not the actual dimension but some percentage value. Do you know a good way to achieve this functionality?

Thanks for any help.

Felix

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 22 Mar 2010, 10:28 AM
Hi Felix,

Indeed, when you get the size of the panes on the server to save them they will always be in pixels and if you set the size in pixels, the splitter and the panes will not resize correctly when the browser is resized which is expected.

What I can suggest is the following:

1) Save the dimensions as they are in pixels
2) When you need to reset the size, calculate the percentages value based on the saved dimensions of the splitter and the panes and set the corresponding percentages

In this manner the proportions should be kept and the splitter will be sized in percentages so that it will resize along with the browser.

All the best,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Splitter
Asked by
Felix
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or