Hi Constantin,
Thanks for contacting Syncfusion support.
By default, the DataTime column will load the date in the format of dd/MM/yyyy hh:mm:ss.
Suggestion 1
In order to change the format of the DataTime column to display only the Date, the Format property can be used. Please make use of below code example and UG,
Code example
|
//To set the Format for the DateTime column
this.gridGroupingControl1.TableDescriptor.Columns["ColumnName"].Appearance.AnyRecordFieldCell.Format = "dd/MM/yyyy"; |
Suggestion 2
The QueryCellStyleInfo event can also be used to set the format for the DateTime column based on condition. In that event, the Format property of GridStyleInfo can be used to set the Format of the date. Please refer to the below code,
Code example
|
//Event Triggering
this.gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo;
//Event Customization
private void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column == null)
return;
if(e.Style.CellValueType == typeof(DateTime) && e.TableCellIdentity.Column.Name == "ColumnName")
{
//To set the Format for the DateTime column
e.Style.Format = "dd/MM/yyyy";
}
} |
Regards,
Arulpriya