We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Resetting splitter in TabBarSplitterControl via DoubleClick

I am using a TabBarSplitterControl with 3 TabBarPages containing grids. In most applications with splitters, such as Excel, after dragging the splitter into the view, you can "un-split" the view by double-clicking on the splitter. I can''t get this to work in my application. I am using a handler for the TabBarPage''s DoubleClick event, because I found that it is the TabBarPage, rather than the TabBarSplitterControl, that receives the DoubleClick event. I know that the DoubleClick event is being fired when I double-click on the splitter, because a breakpoint in the event handler is hit. But nothing I''ve tried within that event has succesfully "un-split" the view. I''ve tried: TabBarPage.HSplitPos = 100; TabBarPage.DisposePane(0, 1); TabBarPage.DeleteColumn(1); TabBarSplitterControl.HSplitPos = 100; TabBarSplitterControl.DisposePane(0, 1); TabBarSplitterControl.DeleteColumn(1); The Syncfusion samples with splitters did not "un-split" the view on a double-click either. I''m probably overlooking something simple. Does anyone know what it is I have to do to "un-split" the view?

5 Replies

AD Administrator Syncfusion Team February 10, 2006 11:57 AM UTC

Hi Bob, By handling the TabBarPage''s DoubleClick and MouseLeave events you can reset the splitters. I have attached a sample. Regards, Calvin.

Splitter.zip


BB Bob Berger February 10, 2006 05:11 PM UTC

Thanks Calvin. This works, but leads to another question. This resets both splitters regardless of which one is double-clicked. That is not the commonly seen behavior. How does one detect which splitter was double-clicked, and reset only that one. I thought perhaps the horizontalSplitterBar and verticalSplitterBar members of the TabBarPage could help. They have a Pushed property that is different depending on which splitter was double-clicked. But I can only access the horizontalSplitterBar and verticalSplitterBar through the debugger. I don''t see how to access them in code.


BB Bob Berger February 14, 2006 09:31 PM UTC

I''m still waiting for an answer to my previous question ("How does one detect which splitter was double-clicked, and reset only that one?"), but now I''ve found a few other issues with the TabBarSplitterControl that I''d like to point out. 1) In Excel, the splitters can only be moved to a cell boundary, but in Syncfusion, the splitters can be moved to the middle of a cell. How can Excel''s behavior be implemented? 2) The TabBarSplitterControl tends to ignore the double-click that is supposed to remove the splitter, when the splitter is positioned close to the top-left corner of the control. For instance, in the splitter.zip sample, if the splitter is dragged into column B, when I double-click on the splitter, it moves further to the left instead of going back to the scroll bar. 3) In Excel, when a grid is split both horizontally and vertically, if only one splitter is removed, the panes for the remaining splitter retain their scroll positions. In my implementation of removing only one splitter, I have to recreate one of the remaining panes, and it does not maintain its scroll position. It seems like I would have to save the scroll position in the DoubleClick event, and restore it in the MouseLeave event. Do I really have to do this? Or should the TabBarSplitterControl be responsible for maintaining the state of the control that is split when one of two concurrent splits is removed. At the very least, it seems like the TabBarSplitterControl should come with instructions on how it can be used to emulate Excel''s behavior.


AD Administrator Syncfusion Team February 20, 2006 04:03 AM UTC

Hi Bob, I apologize for the delay in replying. The  horizontalSplitterBar and the verticalSplitterBar are internal members and it can not be accessed directly. By deriving the TabBarSplitterControl and by overriding the OnMoveSplitter the  horizontalSplitterBar''s and the verticalSplitterBar''s information can be fetched from the sender object and can detect the splitter which was double clicked. I have attached a sample.   Regards, Calvin.

Splitter1.zip


BB Bob Berger February 21, 2006 06:52 PM UTC

Thanks for the answer, Calvin, but... Could you please answer questions 1 and 2 from my post of 2/14/2006 above? (Your Splitter1 sample seems to handle the problem I described in question 3.)

Loader.
Live Chat Icon For mobile
Up arrow icon