Note: if you try to clear the initial minimum value by pressing Backspace or Delete key, the editor value reappears.
To reproduce:
GridViewDecimalColumn decimalColumn2 = new GridViewDecimalColumn("Col2");
decimalColumn2.FieldName = "Number";
decimalColumn2.Minimum = -50;
decimalColumn2.Maximum = 50;
radGridView2.MasterTemplate.Columns.Add(decimalColumn2);
radGridView2.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
radGridView2.EnableFiltering = true;
Workaround:
private void radGridView2_EditorRequired(object sender, Telerik.WinControls.UI.EditorRequiredEventArgs e)
{
if (e.EditorType == typeof(GridSpinEditor))
{
e.EditorType = typeof(CustomEditor);
}
}
public class CustomEditor : GridSpinEditor
{
protected override Telerik.WinControls.RadElement CreateEditorElement()
{
return new CustomElement();
}
}
public class CustomElement : GridSpinEditorElement
{
protected override decimal GetValueFromText()
{
if (string.IsNullOrEmpty(this.Text))
{
return this.MinValue;
}
return base.GetValueFromText();
}
}