DevExpress中的GridControl控件设置了列Readonly后,想双击弹出明细的实现
OptionsBehavior.Editable = true时,会有二个对象触发事件:
view触发ShownEditor 事件(第一单击时)和内置编辑器的DoubleClick事件
所以必须处理这二个事件:
private void gridView1_ShownEditor(object sender, System.EventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
view.ActiveEditor.DoubleClick +=new EventHandler(ActiveEditor_DoubleClick);
}
private void ActiveEditor_DoubleClick(object sender, System.EventArgs e)
{
// your code here;
}