Declined
Last Updated: 06 Feb 2018 06:38 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 30 Aug 2017 05:19
Category: Editors
Type: Bug Report
1
FIX. RadSpinEditor - forbid pasting of non-numeric values
Workaround: 

public RadForm1()
{
    InitializeComponent();

    this.radSpinEditor1.SpinElement.TextChanging += SpinElement_TextChanging;
    this.radSpinEditor1.TextChanged += radSpinEditor1_TextChanged;
}

private void SpinElement_TextChanging(object sender, Telerik.WinControls.TextChangingEventArgs e)
{
    int numericValue = 0;
    if (!int.TryParse(e.NewValue, out numericValue))
    {
        this.radSpinEditor1.Tag = e.OldValue;
        e.Cancel = false;
    }
}

private void radSpinEditor1_TextChanged(object sender, EventArgs e)
{
    if (this.radSpinEditor1.Tag != null)
    {
        this.radSpinEditor1.SpinElement.Text = this.radSpinEditor1.Tag.ToString(); 
        this.radSpinEditor1.Tag = null;
    }
}
0 comments