Completed
Last Updated: 24 Aug 2015 13:05 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 27 Nov 2014 13:37
Category: GridView
Type: Bug Report
1
FIX. RadGridView - ValueChanging and ValueChanged event are fired when the Escape key is pressed in the active editor for the GridViewMaskBoxColumn
To reproduce:

public Form1()
{
    InitializeComponent();

    DataTable dt = new DataTable();

    DataColumn colId = new DataColumn("Id", typeof(int));
    DataColumn colItem = new DataColumn("Item", typeof(string));
    DataColumn colPrice = new DataColumn("Price", typeof(decimal));

    dt.Columns.Add(colId);
    dt.Columns.Add(colItem);
    dt.Columns.Add(colPrice);

    for (int i = 0; i < 10; i++)
    {
        dt.Rows.Add(i % 5, "Item" + i, i * 2.25m);
    }

    GridViewDecimalColumn col = new GridViewDecimalColumn();
    col.HeaderText = "Id";
    col.Name = "Id";
    col.FieldName = "Id";

    radGridView1.Columns.Add(col);

    GridViewTextBoxColumn col1 = new GridViewTextBoxColumn();
    col1.HeaderText = "Item";
    col1.Name = "Item";
    col1.FieldName = "Item";

    radGridView1.Columns.Add(col1);

    GridViewMaskBoxColumn col2 = new GridViewMaskBoxColumn();
    col2.HeaderText = "Price";
    col2.Name = "Price";
    col2.FieldName = "Price";

    col2.MaskType = MaskType.Standard;
    col2.Mask = "###";
    col2.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;

    radGridView1.Columns.Add(col2);
    radGridView1.DataSource = dt;
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

    this.radGridView1.ValueChanging += radGridView1_ValueChanging;
    this.radGridView1.ValueChanged += radGridView1_ValueChanged;
}

private void radGridView1_ValueChanged(object sender, EventArgs e)
{
    Console.WriteLine("ValueChanged");
}

private void radGridView1_ValueChanging(object sender, ValueChangingEventArgs e)
{
    Console.WriteLine("ValueChanging >> old value: " + e.OldValue + " new value: " + e.NewValue);
}


(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments