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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Spreading tabs and header text programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

128058 Dec 29,2016 12:39 AM Jan 8,2017 11:35 PM WPF 5
loading
Tags: SfDataGrid
Dov
Asked On December 29, 2016 12:39 AM

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.

Durga Rajan [Syncfusion]
Replied On January 2, 2017 07:00 AM

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. 


Dov
Replied On January 5, 2017 07:39 AM

Thanks, It's working great.

Any chance to get the same thing to SfDataGrid?

Regards,

Dov.

Gnanasownthari Thirugnanam [Syncfusion]
Replied On January 6, 2017 03:24 AM

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. 


Dov
Replied On January 8, 2017 01:44 AM

Great.
Thank you very much.

Dov.

Gnanasownthari Thirugnanam [Syncfusion]
Replied On January 8, 2017 11:35 PM

Hi Dov,

Thanks for your update.

Please let us know if you need any further assistance.

Regards,

Gnanasownthari T.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;