)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the date time Format in WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: November 13, 2015 |
Last Revised Date: December 31, 2019

Change the date time format

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

//Apply Formatting to a column named “Date” (Format – “dd/MM/yyyy”).  this.gridGroupingControl1.TableDescriptor.Columns["Date"].Appearance.AnyRecordFieldCell.Format = "dd/MM/yyyy";

VB

‘Apply Formatting to a column named “Date” (Format – “dd/MM/yyyy”).  Me.gridGroupingControl1.TableDescriptor.Columns("Date").Appearance.AnyRecordFieldCell.Format = "dd/MM/yyyy"

 

Note:

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

 

Image:

Change the date time format in WinForms GridGroupingControl

Samples:

C#: DateTimeFormat

VB: DateTimeFormat 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
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.

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon