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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to manage time display and validation in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

141810 Jan 5,2019 04:14 AM UTC Jan 7,2019 12:55 PM UTC WinForms 1
loading
Tags: GridGroupingControl
Mariusz Juszkiewicz
Asked On January 5, 2019 04:14 AM UTC

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?

Arulraj A [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;