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.
Unfortunately, activation email could not send to your email. Please try again.

How to change the DateTime Format in GridGroupingControl?

The DateTime Format for a GridGroupingControl date column can be customized by using the Format property of AnyRecordField cell.

C#

 

VB

 

Note:

AnyRecordFieldCell - Gets / sets the GridTableCellStyleInfo with cell settings for any record field cell.

Image:

C:\Users\mohanraj.gunasekaran\Pictures\dateformat.png

Sample:

C#: DateTimeFormat

VB: DateTimeFormat

Article ID: Published Date: Last Revised Date: Platform: Control:
5704 11/13/2015 11/13/2015 Windows Forms GridGroupingControl
Did you find this information helpful?
Comments
QLT User Oct 26, 2016
is there a way to remove the datetime dropdown option in gridgroupingcontrol ?
Reply
Mohanraj Gunasekaran [Syncfusion] Oct 27, 2016

Hi QLT User,

 

Please find the response your query,

is there a way to remove the datetime dropdown option in gridgroupingcontrol ?

 

Solution 1:

In order to hide the dateTime dropdown option, you can achieve your requirement by handling the TableControlCurrentCellShowingDropDown event. Please refer the below code snippet,

Code snippet

this.gridGroupingControl1.TableControlCurrentCellShowingDropDown += gridGroupingControl1_TableControlCurrentCellShowingDropDown;

 

void

gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)

{

    e.Inner.Cancel = true;

}

 

Solution 2:

You can achieve your requirement also using ShowButtons property. Please refer the below code snippet,

Code snippet

this.gridGroupingControl1.TableDescriptor.Columns["Date"].Appearance.AnyRecordFieldCell.ShowButtons = GridShowButtons.Hide;

 

 

 

Regards,

Mohanraj G.

Add Comment
You must log in to leave a comment

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.