Home Forums WinForms controls Xceed Grid for WinForms date and time Reply To: date and time

Xceed Support
Member
Post count: 5658

Our WinDatePicker does not support Time. Here, I would suggest to use the MS DateTimePicker as a CellEditorManager (and an other one as a CellViewerManager).

Here is a code example:

DateTimePicker dtpEditor = new DateTimePicker();
dtpEditor.Format = DateTimePickerFormat.Custom;
dtpEditor.CustomFormat = “yyyy-MM-dd hh:mm:ss”;

DateTimePicker dtpViewer = new DateTimePicker();
dtpViewer.Format = DateTimePickerFormat.Custom;
dtpViewer.CustomFormat = “yyyy-MM-dd hh:mm:ss”;

gridControl1.Columns[ 2 ].CellEditorManager = new CellEditorManager( dtpEditor, “Value”, true, true );
gridControl1.Columns[ 2 ].CellViewerManager = new CellViewerManager( dtpViewer, “Value” );

Imported from legacy forums. Posted by CharlesB (had 639 views)