We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to manage time display and validation in GridGroupingControl

One of the fields in my application requires time input (DateTime). I have tried different cell types: MaskEdit, MonthCalendar, and simple textbox but cannot succeed with solution that I want. With MonthCalendar I use

gGCProposals.TableDescriptor.Columns["ProposalDueTime"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.MonthCalendar;
gGCProposals.TableDescriptor.Columns["ProposalDueTime"].Appearance.AnyRecordFieldCell.Format = "HH:mm";

however, there is no way to stop the dropdown calendar.

With MaskEdit:

gGCProposals.TableDescriptor.Columns["ProposalDueTime"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.MaskEdit;
gGCProposals.TableDescriptor.Columns["ProposalDueTime"].Appearance.AnyRecordFieldCell.MaskEdit = GridMaskEditInfo.Default;
gGCProposals.TableDescriptor.Columns["ProposalDueTime"].Appearance.AnyRecordFieldCell.MaskEdit.Mask = "hh:mm ??";

however, I cannot save into DateTime type.

Does anyone know how to implement for example sfDateTimeEdit with it's DateTime pattern of short time or somthing similar?

1 Reply

AA Arulraj A Syncfusion Team January 7, 2019 12:55 PM UTC

Hi Mariusz, 

Thanks for using Syncfusion product. 

Query 
Solution 
there is no way to stop the dropdown calendar 
To hide the drop down for month calendar, you could use the ShowButtons property. Please refer the following code example. 

C# 
this.gridGroupingControl1.TableDescriptor.Columns["Date"].Appearance.AnyRecordFieldCell.ShowButtons = GridShowButtons.Hide; 
I cannot save into DateTime type 
In mask edit cell type is string format. So, you are unbale to get the exact date. So, we could suggest to use above one. 


Arulraj A 


Loader.
Live Chat Icon For mobile
Up arrow icon