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

Splliter in SharePoint webpart

2 Answers 83 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
govind
Top achievements
Rank 1
govind asked on 30 Sep 2010, 10:18 AM
Hi,

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;
            splitter.Items.Add(leftPane);
            
            // split bar
            var radSplitBar = new RadSplitBar();
            radSplitBar.CollapseMode = SplitBarCollapseMode.Forward;
            
            
            splitter.Items.Add(radSplitBar);


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.
or
                splitter.OnClientResized = "afterResize";  Result : this does not even call the javascript function on page load.
or
                splitter.OnClientResized = "javascript:function afterResize(sender, Args){....}";
                                                                 Result: Does not call the javscript function at all.

Any immediate help is highly appreciated.

Regards,
Govind.

2 Answers, 1 is accepted

Sort by
0
govind
Top achievements
Rank 1
answered on 04 Oct 2010, 06:34 AM
Hi Everyone....

Please let me know if anyone has any clue how to do it...
waiting for reply....
0
Tsvetie
Telerik team
answered on 04 Oct 2010, 09:20 AM
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,
Tsvetie
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
govind
Top achievements
Rank 1
Answers by
govind
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or