I want to close all open tabs at once.

I am providing the functionality of a menu through multiple tabs, and can be closed individually with the close button on the tab head. ShowCloseButton="true"

However, as in the screenshot below (please understand that it is not in English).

I want to close multiple tabs on the left side with the close all button on the right side.

1. The code to close all tabs and
2. I want to know how to place the button on the right side of the header part or activate the all short button.

thank!


3 Replies 1 reply marked as answer

AK Alagumeena Kalaiselvan Syncfusion Team June 19, 2020 12:58 PM UTC

Hi Seil, 

Greetings from Syncfusion support. 

Q1: The code to close all Tabs 

We have checked your reported issue and we suggest you to use RemoveTab public method which helps to remove Tabitems. Also, we have prepared a sample based on your requirement and refer the below code for that. 

<button @onclick="Click">Remove</button> 
 
<SfTab @ref="TabObj" ShowCloseButton="true"> 
        ... 
</SfTab> 
 
@code{ 
    public static SfTab TabObj; 
    public int Count { get; set; } 
    public void Click() 
    { 
        Count = TabObj.Items.Count; 
        for (int i=0; i< Count; i++) 
        { 
            TabObj.RemoveTab(TabObj.Items.Count-1);  // To remove all Tabs 
        } 
    } 
} 

The above sample can be downloaded from the following link. 

Q2: How to place the button on the right side of Tab header. 

We have validated your requirement and we regret to let you know that the button on the right side of the Tab header is not feasible in our Tab component. 

Please let us know, if you  need any further assistance. 

Regards 
Alagumeena.K  

Marked as answer

SE Seil June 22, 2020 04:27 AM UTC

Hi Algumeena.K

Always kind your answers was meaningful to me.

Thank you



VM Vengatesh Maniraj Syncfusion Team June 23, 2020 05:29 AM UTC

Hi Seil, 

Its very pleasure to assist you. 

Please get in touch with us if you would require any further assistance. 

Regards, 
Vengatesh 


Loader.
Up arrow icon