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

CurrentCellValidating and keyboard arrows

Hi, I am using the event “CurrentCellValidating” to do some validations. I get the value entered in the cell as follows: string newValue = grid.CurrentCell.Renderer.ControlText; The problem: Sometimes I might want to change the data entered by the user; like adding a text. grid.CurrentCell.Renderer.ControlText = “$ “ + newValue; If the user presses the “Enter” key, it works fine, but if the user presses an arrow key to move to another cell, the cell displays the edited text but does not exit the editing mode. If the arrow key is pressed again, the cell value is cleared. If the text is not modified in the event, the arrow keys work fine. Thanks.

2 Replies

AD Administrator Syncfusion Team November 12, 2002 11:16 AM UTC

Try setting the Renderer.Control.Text member instead of Rendere.ControlText. this.gridControl1.CurrentCell.Renderer.Control.Text = "$" + this.gridControl1.CurrentCell.Renderer.ControlText;


TM Teodorico Morell November 12, 2002 12:53 PM UTC

Clay, It worked fine. It also helps me to do other stuff like removing the thousand separators when entering edit mode. Thanks.

Loader.
Live Chat Icon For mobile
Up arrow icon