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

TabPrimitives Visible and Dropdown

Hi,

How to show or hide TabPrimitives based on if there are tabs that are not shown when tabs are in single line mode, and how to make the TabPrimitives's dropdown to only show the tabs not shown?

Thanks,

Q

3 Replies

DR Durga Rajan Syncfusion Team September 26, 2017 12:53 PM UTC

Hi Qingde, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and prepared sample to meet your requirement. In this sample we have changed the visibility of the TabPrimitivesHost to true, if the total width of the TabPages are greater than tabcontrol’s width. Otherwise visibility of the TabPrimitivesHost will be false. Please download the sample for the same from below location, 


Please find the code example to update the visibility of the TabPrimitiviesHost from below table, 

        private void UpdatePrimitiveHostVisibility() 
        { 
            int TabRectWidth = 0; 
            if (this.tabControlAdv1 != null && this.tabControlAdv1.TabPages != null) 
            { 
                for (int i = 0; i < this.tabControlAdv1.TabPages.Count; i++) 
                { 
                    TabRectWidth += this.tabControlAdv1.GetTabRect(i).Width; 
                } 
                if (this.tabControlAdv1.Width < TabRectWidth) 
                { 
                    this.tabControlAdv1.TabPrimitivesHost.Visible = true; 
                } 
                else 
                { 
                    this.tabControlAdv1.TabPrimitivesHost.Visible = false; 
                } 
            } 
        } 

If we misunderstood your query please provide more details about your requirement with sample. This would help us to provide the solution at earliest. 

Regards, 
Durga S. 



QS Qingde Shi September 27, 2017 02:00 PM UTC

Great! Thanks. It gave me ideas on how to solve this issue. Tabgap, TabVisible should be considered as well.



DR Durga Rajan Syncfusion Team September 28, 2017 12:31 PM UTC

Hi Qingde, 

Thanks for your suggestions.  

We have modified our sample based on your considerations. In this sample, we have changed the visibility of the TabPrimitivesHost based on the TabVisible property and TabGap property along with TabPages width. 


Please let us know if you need any further assistance. 

Regards, 
Durga S. 


Loader.
Up arrow icon