Is there any update a
|
<style>
.e-toolbar .e-tbar-btn.e-btn .e-icons.e-chevron-left { color: red; } .e-toolbar .e-tbar-btn.e-btn .e-icons.e-chevron-right { color: red; } .e-toolbar .e-toolbar-items .e-toolbar-item.year-active .e-tbar-btn.e-btn, .e-toolbar .e-toolbar-items .e-toolbar-item.month-active .e-tbar-btn.e-btn { color: blue; } </style> @code {
public DateTime CurrentDate { get; set; } = DateTime.UtcNow;
public void Clicked(Syncfusion.Blazor.Navigations.ClickEventArgs args) { for (int i = 0; i < YearToolbar.Items.Count; i++) { YearToolbar.Items[i].CssClass = ""; } for (int i = 0; i < MonthToolbar.Items.Count; i++) { MonthToolbar.Items[i].CssClass = ""; } if (args.Item.Id == "2019") { CurrentDate = DateTime.UtcNow; CurrentDate = CurrentDate.AddYears(-2); OnCreate(); InvokeAsync(() => { StateHasChanged(); }); } if (args.Item.Id == "2020") { CurrentDate = DateTime.UtcNow; CurrentDate = CurrentDate.AddYears(-1); OnCreate(); InvokeAsync(() => { StateHasChanged(); }); } if (args.Item.Id == "2021") { CurrentDate = DateTime.UtcNow; OnCreate(); InvokeAsync(() => { StateHasChanged(); }); } if (args.Item.Id == "2022") { CurrentDate = DateTime.UtcNow; CurrentDate = CurrentDate.AddYears(1); OnCreate(); InvokeAsync(() => { StateHasChanged(); }); } if (args.Item.Id == "Previous") { CurrentDate = CurrentDate.AddDays(-7); OnCreate(); InvokeAsync(() => { StateHasChanged(); }); } if (args.Item.Id == "Next") { CurrentDate = CurrentDate.AddDays(7); OnCreate(); InvokeAsync(() => { StateHasChanged(); }); } } public void OnCreate() { for (int i = 0; i < YearToolbar.Items.Count; i++) { if (CurrentDate.Year.ToString() == YearToolbar.Items[i].Id) { YearToolbar.Items[i].CssClass = "year-active"; } } for (int i = 0; i < MonthToolbar.Items.Count; i++) { if (CurrentDate.Month.ToString() == MonthToolbar.Items[i].Id) { MonthToolbar.Items[i].CssClass = "month-active"; } } } } |
Thank you Satheesh,
Is there any update about my questions?