Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
18810 | Sep 9,2004 02:35 PM UTC | Sep 14,2004 04:21 PM UTC | WinForms | 3 |
![]() |
Tags: GridControl |
private void gridDataBoundGrid1_CurrentCellValidateString(object sender, GridCurrentCellValidateStringEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; int col = this.gridDataBoundGrid1.Binder.NameToColIndex("Col1"); if(cc.ColIndex == col) { GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; int selstart = cr.TextBox.SelectionStart; int sellen = cr.TextBox.SelectionLength; cr.Control.Text = e.Text.ToUpper(); cr.TextBox.SelectionStart = selstart; cr.TextBox.SelectionLength = sellen; } }
this.gridDataBoundGrid1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent;
you can avoid this problem. If you do not want to use this SetCurrent property, then you can try handling grid.KeyDown.
private void gridDataBoundGrid1_KeyDown(object sender, KeyEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(!cc.IsEditing) cc.BeginEdit(); }
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.