「How to: Host Controls in Windows Forms DataGridView Cells」 https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells
DataGridView DateTime Column type?
StewartBW
1,830
Reputation points
Hi experts
In VB.net WinForms (.Net Framework 4.8) DataGridView Add/Edit Column > Column Type has these members:
DataGridViewButtonColumn
DataGridViewCheckBoxColumn
DataGridViewComboBoxColumn
DataGridViewImageColumn
DataGridViewLinkColumn
DataGridViewTextBoxColumn
There's no DataGridViewDateTimeColumn type! So how to set a Column to DateTime to be able to sort at run time by date/time correctly (by clicking on the column header)?
The AI suggested to set the column type to DataGridViewTextBoxColumn and set the DefaultCellStyle.Format = MM-dd-yyyy HH:mm
Is that OK or there are better ways to go with DataGridView?
Thanks everyone :)
Developer technologies | Windows Forms
1,935 questions