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

User (Old forums)
Member
Post count: 23064

As your previous response,  I have been implemented the following

Dim dataRow As DataRow

dataRow = xgc_masterSplReq.DataRows.AddNew()

Dim dtpEditor As New DateTimePicker

dtpEditor.Format = DateTimePickerFormat.Custom

dtpEditor.CustomFormat =

“MM/dd/yy hh:mm:ss”

Dim dtpViewer As New DateTimePicker

dtpViewer.Format = DateTimePickerFormat.Custom

dtpViewer.CustomFormat =

“MM/dd/yy hh:mm:ss”

Dim dateEditor As New DateEditor()

dataRow.Cells(

“Value”).CellEditorManager = New CellEditorManager(dtpEditor, “Value”, True, True)

dataRow.Cells(

“Value”).CellViewerManager = New CellViewerManager(dtpViewer, “Value”)

dataRow.Cells(

“Value”).Value = DateTime.Now

dataRow.EndEdit()

This is working fine But when we didn’t give any default value (i.e. commented the “dataRow.Cells(“Value”).Value = DateTime.Now” code)

It is giving crossmark for the cell and not allowing me to edit. How can I show as empty and allow the user to select the date and time.

Please advise me on this.  Thanks in advance.

 

Imported from legacy forums. Posted by pravi (had 1533 views)