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

How to customize the Edit mode behavior of GridNumericColumn's Cell in SfDataGrid?

Platform: UWP |
Control: SfDataGrid |
Published Date: January 13, 2016 |
Last Revised Date: January 19, 2016
Tags: editing

In SfDataGrid, you can edit the GridNumericColumn cell by pressing any key as input from the keyboard. But you cannot edit the GridNumericColumn cell by pressing the Minus sign (-) key. You can overcome this by deriving the GridCellNumericRenderer and override its ShouldGridTryToHandleKeyDown () method.

The following code example illustrates, how to derive the GridNumericColumn’s renderer and override the ShouldGridTryToHandleKeyDown () method in SfDataGrid.


In the above code example, the ShouldGridTryToHandleKeyDown () method is fired for all key navigations, associated with GridNumericColumn. GridNumericColumn processes the input text in ProcessPreviewTextInput () method. You can customize the editing behavior of GridNumericColumn by specifying the required conditions within it.

The following code example illustrates the default behavior of ProcessPreviewTextInput ().


In the above code example, editing is allowed when the pressed key value is equal to letters or numbers or numberpad otherwise, editing is skipped.

You can allow Edit mode for Minus sign (-) key by skipping its default condition as shown in the following code example.


You can refer to the following code example to remove default the GridCellNumericRenderer and add the customized GridCellNumericRendererExt to the CellRenderers collection in SfDataGrid.



Sample Link:



2X faster development

The ultimate UWP UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile