@using Syncfusion.Blazor.Calendars @using Microsoft.JSInterop <div class="col-lg-12 control-section"> <div class="control-wrapper"> <label class="example-label">DateRangePicker</label> <SfDateRangePicker TValue="DateTime?" Placeholder="Choose a range"> <DateRangePickerEvents TValue="DateTime?" OnOpen="OnOpenHandler" ValueChange="ValueChangeHandler"></DateRangePickerEvents> </SfDateRangePicker> </div> </div> @code { public void ValueChangeHandler(RangePickerEventArgs<DateTime?> args) { // Here, you can customize your code. } [Inject] IJSRuntime JsRuntime { get; set; } public async Task OnOpenHandler(RangePopupEventArgs args) { await JsRuntime.InvokeVoidAsync("bindButtonClickEvents"); } [JSInvokable] public static void ApplyButtonClicked() { // Code to handle apply button click Console.WriteLine("Apply button clicked"); } [JSInvokable] public static void CancelButtonClicked() { // Code to handle cancel button click Console.WriteLine("Cancel button clicked."); } } |