Hi,
I have a grid with numeric data that can be edited by the user. If the user enters a non numeric value the edit should be cancelled and the cell value should revert to the original value (skipping validation). When the grid is bound to a DataTable I am able to do this using the CellValidating event as such:
private void OnManualSplitPointsValidating(object sender, GridViewCellValidatingEventArgs e)
{
if (Helper.IsNumeric(e.NewValue) == false)
{
var grid = (RadGridView) sender;
grid.CancelEdit();
}
}
But when I apply this same code to a CSLA collection the line grid.CancelEdit() causes a row deletion. This may be a problem with the CSLA list but I wanted to check if there is a different way of reverting to the previous value (or if indeed this is supported at all).
I am using the latest Beta and .NET 4.0.
Cheers,
Jose
I have a grid with numeric data that can be edited by the user. If the user enters a non numeric value the edit should be cancelled and the cell value should revert to the original value (skipping validation). When the grid is bound to a DataTable I am able to do this using the CellValidating event as such:
private void OnManualSplitPointsValidating(object sender, GridViewCellValidatingEventArgs e)
{
if (Helper.IsNumeric(e.NewValue) == false)
{
var grid = (RadGridView) sender;
grid.CancelEdit();
}
}
But when I apply this same code to a CSLA collection the line grid.CancelEdit() causes a row deletion. This may be a problem with the CSLA list but I wanted to check if there is a different way of reverting to the previous value (or if indeed this is supported at all).
I am using the latest Beta and .NET 4.0.
Cheers,
Jose