BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
protected override bool ProcessKeyEventArgs(ref Message m) { if(m.Msg == 0x100)// (WM_KEYDOWN) { Keys keyCode = (Keys)((int)m.WParam) & Keys.KeyCode; if(keyCode == Keys.Escape) { this.CurrentCell.CancelEdit(); return true; } } return base.ProcessKeyEventArgs (ref m); }
this.CurrentCell.CancelEdit();
this.CurrentCell.IsModified = false;
return true;
Two, add a GetFormattedText override to the cell model class.
public override string GetFormattedText(GridStyleInfo style, object value, int textInfo) { rtb.Rtf = style.Text; return rtb.Text; }Three, add a grid.CurrentCellRejectedChanges event handler to your form code, and explcitly set the GridAwareTextBox value there.
private void gridControl1_CurrentCellRejectedChanges(object sender, EventArgs e) { GridCurrentCell cc = this.gridControl1.CurrentCell; this.gridAwareTextBox1.Text = this.gridControl1[cc.RowIndex, cc.ColIndex].FormattedText; }Before you try to autosize the cell, try calling grid.CurrentCell.EndEdit to see if that makes things work OK. If not, can you explain how you are trying to autosize the cell (say for a menu item or are youtrying to do it dynamically woith each keystroke or ???)? Can you post a sample showing the problem?