Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
8183 | Oct 24,2003 05:34 PM UTC | Oct 27,2003 03:16 PM UTC | WinForms | 3 |
![]() |
Tags: GridControl |
//subscribe to these event
this.gridControl2.CurrentCellActivating += new GridCurrentCellActivatingEventHandler(gridControl2_CurrentCellActivating);
this.gridControl2.CellDoubleClick += new Syncfusion.Windows.Forms.Grid.GridCellClickEventHandler(this.gridControl2_CellDoubleClick);
this.gridControl2.CurrentCellStartEditing += new CancelEventHandler(gridControl2_CurrentCellStartEditing);
Here are the event handlers and a private member.
private int avoidAutomaticSwitchToEditMode = 0; private void gridControl2_CurrentCellActivating(object sender, GridCurrentCellActivatingEventArgs e) { GridCurrentCell cc = this.gridControl2.CurrentCell; GridStyleInfo style = this.gridControl2[e.RowIndex, e.ColIndex]; if (style.CellType == "MaskEdit") avoidAutomaticSwitchToEditMode = 2; } private void gridControl2_CurrentCellStartEditing(object sender, CancelEventArgs e) { if (avoidAutomaticSwitchToEditMode > 0) e.Cancel = true; avoidAutomaticSwitchToEditMode = Math.Max(0, avoidAutomaticSwitchToEditMode - 1); } private void gridControl2_CellDoubleClick(object sender, GridCellClickEventArgs e) { GridCurrentCell cc = this.gridControl2.CurrentCell; GridStyleInfo style = this.gridControl2[e.RowIndex, e.ColIndex]; if (style.CellType == "MaskEdit") { avoidAutomaticSwitchToEditMode = 0; cc.BeginEdit(true); } }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.