I have a GridView
and I want when I change a cell to see if开发者_如何学JAVA its new value is valid by mine function ValidateValue(string aValue)
and if it is valid - to store the new value and old value as a pair in Struct S {string old,new};
How to do this?
Handle the GridView's ValidatingCell event for this purpose. Here is some sample code showing how to obtain new and old edit values:
private void gridView1_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) {
BaseEdit edit = (sender as GridView).ActiveEditor;
object oldValue = edit.OldEditValue;
object newValue = e.Value;
}
精彩评论