2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Change the date time formatThe DateTime Format for a GridGroupingControl date column can be customized by using the Format property of AnyRecordField cell. //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: Samples: C#: DateTimeFormat VB: DateTimeFormat |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.
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.