|
<SfTab @ref="TabObj">
<TabItems>
<TabItem>
<ChildContent>
<TabHeader Text="HTML"></TabHeader>
</ChildContent>
<ContentTemplate>
<div>HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create web pages. Along with CSS, and JavaScript, HTML is a cornerstone technology, used by most websites to create visually engaging web pages, user interfaces for web applications, and user interfaces for many mobile applications.[1] Web browsers can read HTML files and render them into visible or audible web pages. HTML describes the structure of a website semantically along with cues for presentation, making it a markup language, rather than a programming language.</div>
</ContentTemplate>
</TabItem>
<TabItem>
<ChildContent>
<TabHeader Text="Calendar"></TabHeader>
</ChildContent>
<ContentTemplate>
<SfCalendar TValue="DateTime"></SfCalendar>
</ContentTemplate>
</TabItem>
<TabItem>
<ChildContent>
<TabHeader Text="Grid"></TabHeader>
</ChildContent>
<ContentTemplate>
<SfGrid TValue="Order" AllowPaging="true">
<GridEvents RowSelecting="RowSelectingHandler" TValue="Order"></GridEvents>
<SfDataManager Url="https://js.syncfusion.com/ejServices/Wcf/Northwind.svc/Orders" Adaptor="Adaptors.ODataAdaptor"></SfDataManager>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
</ContentTemplate>
</TabItem>
</TabItems>
</SfTab>
@code{
SfTab TabObj;
List<TabItem> source;
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
public string ShipCountry { get; set; }
}
public RenderFragment ScheduleContent = builder =>
{
builder.AddContent(1,@<SfSchedule TValue=object></SfSchedule>);
};
public void RowSelectingHandler(RowSelectingEventArgs<Order> args)
{
source = new List<TabItem>()
{
new TabItem() { Header = new TabHeader() { Text = "Schedule" }, ContentTemplate = @ScheduleContent }
};
TabObj.AddTab(source, 0);
}
} |