Saving Splitter dimensions per user

2 posts, 0 answers
  1. Felix
    Felix avatar
    15 posts
    Member since:
    Apr 2007

    Posted 15 Mar 2010 Link to this post


    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.


  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 22 Mar 2010 Link to this post

    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,
    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.
Back to Top