Proposed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Have a datagrid with a ColumnChanged event
I want to check the value, if it is incorrect then I need to replace that
value
with the old value.
My problem is using the e.ProposedValue = oldValue; it will not save the
value into the column.

Any help would be great.
here is a little code

private void DGCashBook_ColumnChanged(object sender,
DataColumnChangeEventArgs e)
{
// check the chart code i want to check
if (pm.CheckChart(e.ProposedValue.ToString())
{
// replace recent input for old value (string value)
e.ProposedValue = oldvalue;
}
}
 
Hi Dave,

You should use the ColumnChanging event instead of ColumnChanged.
You might also want to review the following MSDN article:

"Validating Data During Column Changes"

in the "Visual Basic and Visual C# Concepts" section.
 
Back
Top