gridcontrol 的CellValueChanging事件中取不到GetRowCellValue的值?怎么回事啊?
private void gvMain_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
int intRowHandle = e.RowHandle;
if (e.Column == gvMain.Columns.ColumnByFieldName("F_SubjectName"))
{
string FocusedRow_F_SubjectName = gvMain.GetRowCellValue(intRowHandle, "F_SubjectName").ToString();
//GetFind(FocusedRow_F_SubjectName);
}
}
每次触发事件
取到的FocusedRow_F_SubjectName都没有值啊。
------解决方案--------------------
CellValueChanging事件是未发生改变,要在CellValueChanged事件里才能看到改变后的值,而你这里完全不必这样做,可以直接取那个参数CellValueChangedEventArgs e的属性,访问e.Value即可