Hi all,
I've just discovered a little bug in my code, trying to modify the style of a DateTime UltraGrid's cell. Here is the code:
DefaultEditorOwnerSettings dtsettings = new DefaultEditorOwnerSettings();dtsettings.DataType = typeof(DateTime);dtsettings.MaskInput = "dd/mm/yyyy";DateTimeEditor dteditor = new DateTimeEditor(new DefaultEditorOwner(dtsettings));dteditor.DataFilter = new DateEditorDataFilter(); // this is a custom filter classcell.Editor = dteditor;cell.Style = UltraWinGrid::ColumnStyle.DateWithSpin; // <-- here is the bug
I've found out that the last line in my code has no effect: cell is displayed with a combo instead of a spin control. If I comment out cell.Editor assignment, the spin magically appears.
Do you know if a conflict exists between the two properties (cell.Editor vs. cell.Style)? How can I solve it? Thank you bye! Valentina
That makes sense. the Style property determines the cell editor, so if you set the editor explicitly, Style is ignored. You need to add the spin in the DateTimeEditor.
You're right, I was thinking the same thing... But it seems that dteditor doesn't have a Style property.
It only has SpinButtonDisplayStyle and DropDownButtonDisplayStyleDropDown. Nothing related to showing/hiding time information, while cell.Style property can be set to both DateWithSpin and DateTimeWithSpin values. Is this "time-hiding" work only accomplished by MaskInput settings?
Thanks a lot, bye!