<TabItems>
<TabItem Content="@Content1">
<ChildContent>
<TabHeader Text="Twitter">
</TabHeader>
</ChildContent>
</TabItem>
</TabItems>
@code{
public string Content1 = "Twitter is an online social networking service that enables users to send and read short 140-character messages called tweets.";
} |
<TabItems>
<TabItem>
<ChildContent>
<TabHeader Text="Counter">
</TabHeader>
</ChildContent>
<ContentTemplate>
<Counter />
</ContentTemplate>
</TabItem>
</TabItems> |
WeatherForecast[] forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
}
|
<EjsTab>
<TabItems>
<TabItem ContentTemplate="@Content1">
<ChildContent>
<TabHeader Text="Tab1"></TabHeader>
</ChildContent>
</TabItem>
<TabItem ContentTemplate="@Content2">
<ChildContent>
<TabHeader Text="Tab2"></TabHeader>
</ChildContent>
</TabItem>
<TabItem ContentTemplate="@Content3">
<ChildContent>
<TabHeader Text="Tab3"></TabHeader>
</ChildContent>
</TabItem>
</TabItems>
</EjsTab>
@code {
public RenderFragment Content1 = builder =>
{
builder.AddContent(1, "Twitter is an online social networking service that enables users to send and read short 140-character messages called tweets.");
};
public RenderFragment Content2 = builder =>
{
builder.AddContent(1, @<FetchData />);
};
public RenderFragment Content3 = builder =>
{
builder.AddContent(1, @<EjsButton IsPrimary="true">CONTENT BUTTON</EjsButton>);
};
} |
Hi Nick,
Query 1:
We could reproduce the reported RenderFragment issue in
ContentTemplate property of TabItem. We are investigating the issue further in
detail and we will update you regarding this issue on September 10, 2019.
Query 2:
You can hide the close icon to specific items by using
CssClass property in TabItem. Refer the below code snippet.
<TabItem ContentTemplate="@Content1" CssClass="non-closeable">
<ChildContent>
<TabHeader Text="Tab1"></TabHeader>
</ChildContent> </TabItem>
<style>
.e-tab .e-tab-header .e-toolbar-items .non-closeable .e-tab-wrap .e-text-wrap .e-close-icon {
display: none; } </style>
|
The sample can be downloaded from the following link.
https://www.syncfusion.com/downloads/support/forum/146997/ze/TabSetContent1694218030
Please try out the sample and let us know if you need any
further assistance.
Regards,