Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Set Splitter Distance on DocumentContentHost
posted
I am using the following code to add two panes to my control.  
I would like the top pane to take up  75% of the space available by default.  
How can I set the splitter distance? 
Also, can I control the background and height of the splitter?
<igDock:XamDockManager Name="xamDockManager1" Grid.Row="2">
                <igDock:XamDockManager>
                    <igDock:DocumentContentHost Padding="-1">
                        <igDock:SplitPane SplitterOrientation="Horizontal">
                            <igDock:TabGroupPane Padding="-3">
                                <igDock:ContentPane Header="Results" AllowClose="false">
                                    <ContentControl Content="{Binding GridVM.View}"></ContentControl>
                                </igDock:ContentPane>
                            </igDock:TabGroupPane>
                            <igDock:TabGroupPane Padding="-3">
                                <igDock:ContentPane Header="Cross Section Data" AllowClose="false">
                                    <ContentControl Content="{Binding GridVM.CrossSectionVM.View}" ></ContentControl>
                                </igDock:ContentPane>
                            </igDock:TabGroupPane>
                        </igDock:SplitPane>
                    </igDock:DocumentContentHost>
                </igDock:XamDockManager>
            </igDock:XamDockManager>
  • 30945
    Offline posted

    Hello Daniel,

    I am just checking the progress on your issue.

    Please let me know if you require any further assistance on the matter.

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support

     

  • 30945
    Offline posted

    Hello David,

    The percentage of the available space for SplitPane’s children is determined by its attached property RelativeSize. In order to set the top pane to take 75% of the available space you need to set the RelativeSize property of the top pane as follows:

    <igDock:TabGroupPane Padding="-3" igDock:SplitPane.RelativeSize="300, 400">

     

    That will cause the top pane to take ¾ of the available size which is 75%.

    To get the splitter you need to handle the Loaded event of the SplitPane and in the event handler you can get the splitter of the pane using the Utilities class’ method GetDescendantFromType. Here is an example for setting the splitter height to 50 pixels and the background to red:

     

    1)      Handle Loaded event for the SplitPane

    <igDock:SplitPane Loaded="SplitPane_Loaded"

    SplitterOrientation="Horizontal">

     

    2)      Get the SplitPaneSpliter in the event handler and set its properties

     

            private void SplitPane_Loaded(object sender, RoutedEventArgs e)

            {

                SplitPaneSplitter splitter =

                    Utilities.GetDescendantFromType(

                    (sender as SplitPane),

                    typeof(SplitPaneSplitter),

                    true) as SplitPaneSplitter;

     

                splitter.Background = Brushes.Red;

                splitter.Height = 50;

            }

     

    Please let me know if this is what you needed and if you require any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support