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. Image for the cookie policy date
close icon

How do I move a cursor in a current cell.

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

3 Replies

AD Administrator Syncfusion Team 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


KM Kwabena Manu 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


KM Kwabena Manu 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

Loader.
Live Chat Icon For mobile
Up arrow icon