We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

continue to next cell while typing

Thread ID:

Created:

Updated:

Platform:

Replies:

8055 Oct 17,2003 03:58 PM UTC Oct 22,2003 09:20 PM UTC WinForms 3
loading
Tags: GridControl
Doug
Asked On October 17, 2003 03:58 PM UTC

Is there any way to continue to the next cell when I type the maximum number of allowed characters in a TextBox cell or MaskEdit cell? Thanks.

Administrator [Syncfusion]
Replied On October 17, 2003 09:13 PM UTC

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)
	{
		this.gridControl1.CurrentCell.MoveRight(1, false);
	}
}

Desis Machino
Replied On October 22, 2003 05:22 PM UTC

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?

Administrator [Syncfusion]
Replied On October 22, 2003 09:20 PM UTC

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.

CONFIRMATION

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;