Splliter in SharePoint webpart

3 posts, 0 answers
  1. govind
    govind avatar
    12 posts
    Member since:
    Sep 2010

    Posted 30 Sep 2010 Link to this post


    My aim is to retain the splitter position after postback or new page request or cross page request.

    for example i have welcome page that contains the link to webpart page where my webpart exist with splitter.
    When i set the splitter position and move back to welcome page and then go again to the webpart page, the position of the splitter should exist.
    i know i need to store the value in cookie and then re-assigned the value to the Radpane anyother other solution if exist please let me know, with any code example.
    So I want to grab the splitter width on On-ClientResized  event. and assign to the radpane back in OnClientLoad event.

    However right now i am facing issue, for raising the OnClient-Resized event.
    My code goes here.. This code is called in CreateChildControls() method....

             splitter = new RadSplitter();
                splitter.ID = Constant.SPLITTERCLIENTID;
                splitter.Width = Unit.Percentage(100);
                splitter.Height = Unit.Percentage(100);
                    splitter.OnClientResized = "afterResize()";
                 //left pane for tree view
                leftPane = new RadPane();
                leftPane.Width = Unit.Pixel(200);
                leftPane.Scrolling = SplitterPaneScrolling.Both;
                leftPane.MinWidth = 150;
                // split bar
                var radSplitBar = new RadSplitBar();
                radSplitBar.CollapseMode = SplitBarCollapseMode.Forward;

    It does not fire the event when i resize the splitter bar.
    Following options i tried
                    splitter.OnClientResized = "afterResize()"; Result: call the javascript function on Page load and not on re-sizing.
                    splitter.OnClientResized = "afterResize";  Result : this does not even call the javascript function on page load.
                    splitter.OnClientResized = "javascript:function afterResize(sender, Args){....}";
                                                                     Result: Does not call the javscript function at all.

    Any immediate help is highly appreciated.

  2. govind
    govind avatar
    12 posts
    Member since:
    Sep 2010

    Posted 04 Oct 2010 Link to this post

    Hi Everyone....

    Please let me know if anyone has any clue how to do it...
    waiting for reply....
  3. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 04 Oct 2010 Link to this post

    Hi Govind,
    The correct way to attach a handler for a client-side event of the splitter using a server-side property is the following:
    splitter.OnClientResized = "afterResize";

    However, the resized client-side event of the splitter is raised when the splitter itself is resized. And when you move a splitBar, the splitter is not resized - the two panes on each side of the splitBar are resized. That is why, you need to handle the resized event of the panes and not that of the splitter. For example:
    leftPane.OnClientResized = "afterResize";

    Sincerely yours,
    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