Posted 2 August 2019, 3:52 pm EST
I have an object collection that I display in a C1TrueDBGrid. This object contains some DateTime? properties. I’m attempting to use a C1DateEdit control as the custom editor for those properties. If I use the dropdown date picker, all is well – it behaves as expected. However, if I attempt to enter dates via the keyboard, things go south.
Clicking on the first field, then entering a date, then pressing RETURN (or ENTER) ends with the expected result (the date I entered is shown in the cell.
Navigating to the next DateTime? cell, whether in the same row or another row (I’m using the arrow keys to navigate at this point) and beginning to enter a date results in the following exception as soon as I press the first key:
System.Exception: Cannot assign text to readonly, disabled or hidden C1Input
control when its Text property is not detached.
at C1.Win.C1Input.C1TextBox.set_Text(String value)
at C1.Win.C1TrueDBGrid.C1EmbeddedEditor.C1EditorInitialize(Object value, IDictionary attributes)
at C1.Win.C1TrueDBGrid.BaseGrid.View.InitEditorSession(Style style, Rectangle r, Object data, Char key, Boolean isMouse, String mask, C1DisplayColumn dc, Boolean readOnly)
at C1.Win.C1TrueDBGrid.BaseGrid.View.BeginEdit(Char key, Boolean isMouse, Boolean fire)
at C1.Win.C1TrueDBGrid.Split.BeginEdit(Char key, Boolean isMouse, Boolean fire)
at C1.Win.C1TrueDBGrid.BaseGrid.Frame.OnKeyPress(KeyPressEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at C1.Win.C1TrueDBGrid.BaseGrid.Frame.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The version of the C1 controls is 4.0.20183.343. I’m attaching a small sample project that demonstrates the problem.
