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

need to move cursor within the cell

Thread ID:





47789 Aug 11,2006 03:50 PM UTC Aug 14,2006 04:58 PM UTC WinForms 2
Tags: GridControl
Irina Jouk
Asked On August 11, 2006 03:50 PM UTC


I have a grid and a grouping control. For both of them there is a cell to enter a decimal number in a "#.0" format.
Is there a way to move cursor within the cell to another position?
For example:
Let’s say we have a value 11.4 in the cell. Then user types dot after the first “1”, i.e current value is getting “1.1.4” and at that moment I need to move cursor after the decimal point, i.e to have “11.(here is cursor)4”. If I just remove first dot or put some other logic to have correct value in the cell, it still keeps cursor at the position where user types the dot but not after the decimal point.
Another example, when user types the dot right before the decimal point. When I remove the dot, the cursor still stays before decimal point, but should stay after it.

Thanks in advance,

Administrator [Syncfusion]
Replied On August 14, 2006 04:51 AM UTC

Hi Irina,

You can access the GridTextBoxCellRenderer and can move the cursor positioin using SelectionStart property of TextBoxCell. Here is a code snippet

private void gridl1_TableControlCurrentCellKeyPress(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyPressEventArgs e)
if( e.Inner.KeyChar == ''.'')
Console.WriteLine("Dot pressed");
e.Inner.Handled = true;
GridTextBoxCellRenderer render = e.TableControl.CurrentCell.Renderer as GridTextBoxCellRenderer;
if( render != null)
render.TextBox.SelectionStart = 3;
render.TextBox.SelectionLength = 0;

Let me know if this helps.

Irina Jouk
Replied On August 14, 2006 04:58 PM UTC

Thanks very much Haneef. It helped



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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