我在 Devexpress CustomGridView 中有这个 Repository Item comboboxEdit。
private void gridView1_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
{
if (e.Column == this.gcCol1)
{
var repositoryItem = new RepositoryItemComboBox();
foreach (var title in this.ViewModelList.Titles)
{
repositoryItem.Items.Add(title.TitleName);
}
repositoryItem.EditValueChanged += this.PostEditValueChanged;
repositoryItem.Validating+=this.validating;
e.RepositoryItem = repositoryItem;
}
}
private void PostEditValueChanged(object sender, EventArgs e)
{
this.gridView1.PostEditor();
}
EditValueChanged 在键入时触发多次。有没有办法在用户完全编辑完单元格后触发此 EditValueChanged 一次。这些方面的东西http://www.devexpress.com/Support/Center/Question/Details/Q288616 Devexpress Support 对此问题进行了一些修复,但似乎没有帮助。不确定为什么 activeeditor 正在关闭并重置光标。我不想在 EditValueChanged 中设置插入符号位置。
我也试过 CellvalueChanged 但这需要在用户控件中单击。与 repository.validating 相同
repositoryItem.EditValueChanged += this.PostEditValueChanged;
repositoryItem.Validating+=this.validating;
有没有办法确定用户是否已完成或仍在编辑组合框,然后触发 editvaluechanged 而不必担心组合框编辑之外的点击