|
@using Syncfusion.EJ2.Blazor.Navigations
<button @onclick="ClickToRemoveTab">Remove Tab</button>
<br/>
<EjsTab @ref="TabObj">
<TabItems>
<TabItem Content="Hypertext Markup Language, commonly referred to as HTML, is the standard markup language used to create webpages.">
<ChildContent>
<TabHeader Text="HTML"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="C# is intended to be a simple, modern, general-purpose, object-oriented programming language.">
<ChildContent>
<TabHeader Text="C Sharp(C#)"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="Java is a set of computer software and specifications developed by Sun Microsystems, later acquired by OracleCorporation, that provides a system for developing application software and deploying it in a cross - platform computing environment.">
<ChildContent>
<TabHeader Text="Java"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="The command-line compiler, VBC.EXE, is installed as part of the freeware .NET Framework SDK.">
<ChildContent>
<TabHeader Text="VB.Net"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="Xamarin is a San Francisco, California based software company created in May 2011 by the engineers that created Mono, Monofor Android and MonoTouch that are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications (often called Microsoft .NET). With a C#-shared codebase, developers can use Xamarin tools to write native Android, iOS, and Windows apps with native user interfaces and share code across multiple platforms.">
<ChildContent>
<TabHeader Text="Xamarin"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="ASP.NET is an open-source server-side web application framework designed for web development to produce dynamic web pages.">
<ChildContent>
<TabHeader Text="ASP.NET"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="The ASP.NET MVC is a web application framework developed by Microsoft, which implements the model–view–controller(MVC) pattern. It is open - source software, apart from the ASP.NET Web Forms component which is proprietary.">
<ChildContent>
<TabHeader Text="ASP.NET MVC"></TabHeader>
</ChildContent>
</TabItem>
</TabItems>
</EjsTab>
@code{
EjsTab TabObj;
public void ClickToRemoveTab()
{
var removeStart = 2; // Define the tab index from where you begin to remove tab items
var removedItemsCount = TabObj.Items.Count ;
for (var i = removeStart; i < removedItemsCount; i++)
{
TabObj.RemoveTab(TabObj.Items.Count-1); // To Remove the tab items
}
}
} |
Hi. I think there is a misunderstood here.
The problem that Nick (and also me) are having is that, when you Remove a tab with RemoveTab method, (passing an index) it removes NOT only that tab, but all the following ones.
The method RemoveTab should only remove the specified Tab. Isn't that a bug?
Thank you Alagumeena.
Hi Xavier,
You can use RemoveTab public method to remove the specified tab.
Kindly try the above links and let us know further assistance.
Regards,
Satheesh Kumar B