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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I move a cursor in a current cell.

Thread ID:

Created:

Updated:

Platform:

Replies:

48332 Aug 24,2006 05:37 PM UTC Aug 25,2006 02:45 PM UTC WinForms 3
loading
Tags: GridControl
Kwabena Manu
Asked On August 24, 2006 05:37 PM UTC

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 04:06 AM UTC

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 02:45 PM UTC

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 02:45 PM UTC

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.

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

;