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

Spreading tabs and header text programmatically

Hi,

I've created the following code:

  <syncfusion:GroupBar   >
            <!--Group Bar Item-->
            <syncfusion:GroupBarItem Name="AdvancedEquationEditorParameters" ShowInGroupBar="True" IsExpanded="True"  Width="400" >
                <GroupBox Name="Advanced_EquationEditorParameters" Margin="5"  >
                    <Grid VerticalAlignment="Stretch" >
 
                        <DockPanel>
                            <TextBox Name="EquationEditor" DockPanel.Dock="Top" Height="60"    VerticalAlignment="Top" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Margin="5" ></TextBox>
                      

                        <syncfusion:DockingManager Name="Docking"  Margin="5"
                                 UseDocumentContainer="True"
                                 DisabledCloseButtonsBehavior="Hide"                                   
                                 DocumentCloseButtonType="Individual"
                                  ShowTabItemContextMenu="False"
                                   ShowTabListContextMenu="False"
                                                 
                                   >
                            <ContentControl Name="Child"
                             syncfusion:DockingManager.CanClose="False"                          
                             syncfusion:DockingManager.Header="Dock1"
                             syncfusion:DockingManager.CanDragTab="False"
                             syncfusion:DockingManager.State="Document">
                            </ContentControl>
                            <ContentControl
                             syncfusion:DockingManager.CanClose="False"
                             syncfusion:DockingManager.Header="Dock2"
                             syncfusion:DockingManager.CanDragTab="False"
                             syncfusion:DockingManager.State="Document">
                            </ContentControl>
                            <ContentControl
                             syncfusion:DockingManager.CanClose="False"
                             syncfusion:DockingManager.Header="Dock3"
                             syncfusion:DockingManager.CanDragTab="False"
                             syncfusion:DockingManager.State="Document">
                            </ContentControl>
                             
                            </syncfusion:DockingManager>
 
                        </DockPanel>
 
                    </Grid>

                </GroupBox>
            </syncfusion:GroupBarItem>
        </syncfusion:GroupBar>



I'm trying to:

1. spread the tabs so that the 3 tabs will be spread on the entire row (without any space in the end).

2. I'm trying to set the header of the tab programmatically from the code behind, so that I could remove the line:
syncfusion:DockingManager.Header="Dock1" (for example).


Is it possible?

Regards,

Dov.

5 Replies

DR Durga Rajan Syncfusion Team January 2, 2017 12:00 PM UTC

Hi Dov, 

Thank you for contacting Syncfusion Support. 

We can make the tabs to split and occupy available space equally by setting TabItemLayout property of DocumentTabControl as MultiLineWithFullWidth. The header for the dock child can be set programmatically as shown in following code snippet: 

DockingManager.SetHeader(Child, "Dock one"); 
 

We have modified your sample and you can download it from the following location. 


Regards, 
Durga S. 



DO Dov January 5, 2017 12:39 PM UTC

Thanks, It's working great.

Any chance to get the same thing to SfDataGrid?

Regards,

Dov.


GT Gnanasownthari Thirugnanam Syncfusion Team January 6, 2017 08:24 AM UTC

Hi Dov, 

We have analyzed your query, you can achieve your requirement in below mentioned ways. 
 
Query 1: Spread the tabs so that the 3 tabs will be spread on the entire row (without any space in the end) 
You can achieve your requirement by setting SfDataGrid.ColumnSizer as ”Star”, it equally split the each column in an each row. 

XAML: 
<Syncfusion:SfDataGrid x:Name="datagrid"  
                                       ColumnSizer="Star" 
                                       AllowEditing="True"            
                                       ItemsSource="{Binding OrderInfoCollection }"> 
 
Please refer the below UG link: 
 
Query 2: Setting Header programmatically. 
You can set the “GridColumn.HeaderText” property from programmatically like below code example. 

C#: 
this.datagrid.Columns.Add(new GridTextColumn() { HeaderText = "Order ID", MappingName = "OrderID" }); 
 
Please refer the below UG link: 
 
 
We have prepared sample as per your requirement, you can download the same from below mentioned location. 
Sample location: 

If your requirement is differ from this, please let us know with more details about your requirement. That would be helpful for us to serve you better. 
 
Regards, 
Gnanasownthari T. 



DO Dov January 8, 2017 06:44 AM UTC

Great.
Thank you very much.

Dov.


GT Gnanasownthari Thirugnanam Syncfusion Team January 9, 2017 04:35 AM UTC

Hi Dov,

Thanks for your update.

Please let us know if you need any further assistance.

Regards,

Gnanasownthari T.



Loader.
Up arrow icon