Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
795
ultranumeric editor allowing nulls even when nullable=false
posted
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.