The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a grid with a datetime column. By default the column will have no default values and the cells empty. When a user click into the cell to dropdown the datepicker I want it to default to a future date, not today's date. Is there a way to do this. I tried using CurrentCellStartEditing and the grdData.CurrentCell.Renderer to get the control but it doesn't seem to work. Anyone have any ideas.
HAhaneefm Syncfusion Team April 18, 2007 09:51 PM UTC
Hi Ken,
One way you can do this by hanlding the CurrentCellShowingDropDown event of the grid and change the TodayDate of the MonthCalendar control in a grid. Here is a code snippet.
private void gridDataBoundGrid1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e) { GridDataBoundGrid grid = sender as GridDataBoundGrid ; GridDropDownMonthCalendarCellRenderer cr = grid.CurrentCell.Renderer as GridDropDownMonthCalendarCellRenderer; if( cr != null ) { foreach(Control c in cr.DropDownContainer.Controls ) { if( c is MonthCalendar ) { MonthCalendar calendar = c as MonthCalendar; DateTime future = DateTime.Now.AddDays(1); calendar.TodayDate = future; break; } } } }