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

Cell text caret/cursor moves on a grid Refresh in non-edit mode

The default behaviour of the Syncfusion grid is to show a text cursor in the cell you click on - you can position the cursor within some text without actually going into edit mode.

However, if the grid refreshes (say a timer has fired and calls grid.Refresh()) then the cursor moves to the beginning of the text.

What this means is if the user wants to position the cursor and then start typing, if a refresh occurs before they start typing they will enter text at the wrong place.

Are there any properties I can set to change this behaviour or methods to override so the text cursor doesn't move around. Otherwise, we'll have to prevent the cursor from showing (maybe using the ActivateCurrentCellBehavior property) unless the user actually enters Edit mode.

Thanks.

1 Reply

AD Administrator Syncfusion Team March 6, 2007 05:45 PM UTC

Hi jas_sl,

This a default behavior. But one way you can keep the current cell cursor by calling the refresh method between the GetEditState and SetEditState method. Here is a code snippet

//Form.Load event.
button1.CausesValidation = true;

//button1.Click event.
object editObject = this.grid.CurrentCell.Renderer.GetEditState();
this.grid.Refresh();
this.grid.Focus();
this.grid.CurrentCell.Renderer.SetEditState(editObject);

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon