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.
Unfortunately, activation email could not send to your email. Please try again.

How do I move a cursor in a current cell.

Thread ID:

Created:

Updated:

Platform:

Replies:

48332 Aug 24,2006 01:37 PM Aug 25,2006 10:45 AM Windows Forms 3
loading
Tags: GridControl
Kwabena Manu
Asked On August 24, 2006 01:37 PM

I have a text in a cell and I want to be able to move the cursor before or after any of the letters so that I can enter my new letters from the cursor position.

Thanks

Administrator [Syncfusion]
Replied On August 25, 2006 12:06 AM

Hi Kwabena,

You can access the GridTextBoxCellRenderer and can use SelectionStart property of TextBox to set starting point of text selected in the cell.

this.grid.Focus();
this.grid.CurrentCell.BeginEdit();
GridTextBoxCellRenderer render = this.grid.CurrentCell.Renderer as GridTextBoxCellRenderer;
if( render != null)
{
render.TextBox.SelectionStart = 5;
render.TextBox.SelectionLength = 1;
}

Let me know if this helps.

Best Regards,
Haneef

Kwabena Manu
Replied On August 25, 2006 10:45 AM

Thanks a lot Haneef.
It worked.

>Hi Kwabena,

You can access the GridTextBoxCellRenderer and can use SelectionStart property of TextBox to set starting point of text selected in the cell.

this.grid.Focus();
this.grid.CurrentCell.BeginEdit();
GridTextBoxCellRenderer render = this.grid.CurrentCell.Renderer as GridTextBoxCellRenderer;
if( render != null)
{
render.TextBox.SelectionStart = 5;
render.TextBox.SelectionLength = 1;
}

Let me know if this helps.

Best Regards,
Haneef

Kwabena Manu
Replied On August 25, 2006 10:45 AM

Thanks a lot Haneef.
It works.

>Hi Kwabena,

You can access the GridTextBoxCellRenderer and can use SelectionStart property of TextBox to set starting point of text selected in the cell.

this.grid.Focus();
this.grid.CurrentCell.BeginEdit();
GridTextBoxCellRenderer render = this.grid.CurrentCell.Renderer as GridTextBoxCellRenderer;
if( render != null)
{
render.TextBox.SelectionStart = 5;
render.TextBox.SelectionLength = 1;
}

Let me know if this helps.

Best Regards,
Haneef

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.

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.

;