Completed
Last Updated: 14 Oct 2015 12:57 by ADMIN
ADMIN
Dimitar
Created on: 31 Aug 2015 07:48
Category: GridView
Type: Bug Report
0
FIX. RadGridView - the specified column data type is not respected in the CellValidating event.
To reproduce:
public RadForm1()
{
    InitializeComponent();
    radGridView1.AutoGenerateColumns = false;
  
    GridViewDecimalColumn decimalColumn = new GridViewDecimalColumn();
    decimalColumn.DataType = typeof(int);
    decimalColumn.Name = "DecimalColumn";
    decimalColumn.HeaderText = "DecimalColumn";
    decimalColumn.FieldName = "Dosage";
    decimalColumn.Width = 200;
    radGridView1.MasterTemplate.Columns.Add(decimalColumn);
    
    radGridView1.DataSource = GetTable();
    radGridView1.CellValidating += radGridView1_CellValidating;
    
}

void radGridView1_CellValidating(object sender, CellValidatingEventArgs e)
{
    int value = Convert.ToInt32(e.Value);
}

Workaround:
void radGridView1_CellValidating(object sender, CellValidatingEventArgs e)
{
    int value = Convert.ToInt32(e.Value);
}
0 comments