ADAdministrator Syncfusion Team October 17, 2003 04:13 PM
I think you can use CurrentCellChanged to do this for a TextBox.
private void gridControl1_CurrentCellChanged(object sender, System.EventArgs e)
GridCurrentCell cc = this.gridControl1.CurrentCell;
int len = this.gridControl1[cc.RowIndex, cc.ColIndex].MaxLength;
if(cc.Renderer.ControlText.Length == len)
DMDesis MachinoOctober 22, 2003 12:22 PM
This works great if I am in insert mode, but if the user is in overwrite mode, and the cell already has the max number of chars, this approach will not work.
Is there a way to determine the location within the cell the user has typed a key? Or is there a better solution?
ADAdministrator Syncfusion Team October 22, 2003 04:20 PM
You can use code like
GridTextBoxControl tb = cc.Renderer.Control as GridTextBoxControl;
to get the textbox from the currentcell renderer. But, I do not know of a simple way to decide whether you are in the overstrike mode. The TextBox and RichTextBox don't seem to expose such a property.
So, I think any solution will require some more coding to handle the particular situations.