Janus GridEX:无法在 CellValueUpdated 事件上获取新编辑的值

Janus GridEX: Cannot get the newly edited value on CellValueUpdated event

处理时如何获取当前编辑的值:

public class GridEX // ...
{
    // ... 
    public event ColumnActionEventHandler CellValueChanged;
    // ...
};

正在尝试使用以下方法获取值:

GridEXCell valueChangedCell = _gridView.CurrentRow.Cells[<desired_column_index>];
object rawValue = valueChangedCell.Value;
// or even with
string rawValue = valueChangedCell.Text;

valueChangedCell 值发生变化的唯一时刻是 CellUpdatedUpdatingCell 事件被触发时。但后两者仅在用户将键盘输入焦点更改为另一个单元格时才会触发,这可能是为了应用编辑后的单元格的新值。我要查找其值的单元格是一个只包含一个复选框的单元格。我想在切换给定单元格的复选框后立即执行给定操作,而不是在用户更改焦点后立即执行给定操作,例如移动到 table 中的另一个单元格。看到在事件的描述中提到了一些行缓冲区:

[Description("Occurs after changes in a cell are copied into the row's buffer.")]
public event ColumnActionEventHandler CellUpdated;

[Description("Occurs before updating the changes in a cell to the row's buffer")]
public event UpdatingCellEventHandler UpdatingCell;

我假设复选框的当前值可能保存在某个缓冲区中,并且在更改焦点后,新值将应用于单元格。

任何想法如何在处理 Janus 时获取复选框的当前设置值 GridEX.CellValueChanged

晚会有点晚了,但由于我遇到了同样的困难,我决定在 Cell Changed 是 CheckBox 时刷新挂起的更改

private void gridEX1_CellChanged(object sender, ColumnActionEventArgs e)
{
    if (e.Column.ColumnType == ColumnType.CheckBox)
    {
        gridEX1.UpdateData(); // Flush any pending changes
    }
}

这将触发另一个处理验证的处理程序(在我的例子中)

我解决了添加在以下事件中触发的方法的问题:private void

CloseEditMode() 
{ 
   gridRubrica.AllowEdit = InheritableBoolean.False; 
   gridRubrica.AllowEdit = InheritableBoolean.True; 
} 

private void gridRubrica_CellValueUpdated(object sender, ColumnActionEventArgs e) 
{ 
   if (e.Column.Key.Equals("Selected")) { CloseEditMode(); } 
}