I have declared an ultranumeric editor and assigned it to a ultragrid in the editorComponent
The declaration is as follows
UltraNumericEditor ultraNumEditor = new UltraNumericEditor(); ultraNumEditor.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always; ultraNumEditor.FormatString = "#0"; ultraNumEditor.NumericType = NumericType.Double; ultraNumEditor.MaskInput = "nnnnnnnnnnn"; ultraNumEditor.Nullable = false; grdTrades.DisplayLayout.Bands[0].Columns[COLUMN_COMMITTEDQUANTITY].EditorComponent = ultraNumEditor; grdTrades.DisplayLayout.Bands[0].Columns[COLUMN_COMMITTEDQUANTITY].CellActivation = Activation.AllowEdit;
The above editor is allowing the user to clear the data and keep it blank, in which case it returns DBNull as the value. I want the NumericEditor control to automatically set the blank value to zero. Also in the above I want the user to enter only non negative numbers without any decimals.
Hi Puneet,
This is happening because the grid column uses its own properties and not the properties of the editor. So even if you set the Nullable property of the UltraNumericEditor to false, it still uses the default value of the column which is “Automatic”. When it's set to Automatic, the UltraGrid tries to detect if the column allows null and if so it puts DBNull otherwise it puts empty string (""). If you use embeddable editors in a grid column most of their properties are ignored and the grid uses the column’s properites instead.
Please let me know if you have any additional questions.
Hi Mitko,
The ultranumericeditor is not behaving in the above way when it is inside the grid for nullable false. The value assigned is DBnull.Value even when the Nullable property is set to false.
This was the original problem which I had mentioned and which still working wrong. We have workarounds around it but this functionality for ultranumericeditor is working wrong.
Thank you for the reply.
If Nullable is set to false and the string is cleared the value of the editor becomes 0. If it is set to true, the value will be DBNull.Value.
My comment on 15 Jan has still not been answered
Hello Puneet,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.