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

How to load UpDown in SfDataGrid and set the different step value to each row of UpDown ?

Platform: WPF |
Control: SfDataGrid |
Published Date: July 28, 2015 |
Last Revised Date: December 27, 2016 |
.NET Framework: 4.5

SfDataGrid allows you to load different cell types with the help of GridTemplateColumn. You can load UpDown control by using GridTemplateColumn.EditTemplate property of that column as follows

XAML

 

In above code example, the TextBlock control is loaded in Display mode and UpDown control is loaded in edit mode as shown in the screenshot ,

By default, the Step value of UpDown control will be 1. You can customize these Step value and adjust it for each row of that corresponding column. By using the PreviewMouseDown and PreviewKeyDown event, you can adjust Step value while the mouse or Up and Down arrow key is used for adjusting the Step of UpDown control.

The following code sample shows the step value is set based on the certain condition when mouse is pressed,

C#

 

You can refer the following code sample to achieve the same when Up and Down arrow key is pressed,

C#

 

Refer to the sample for setting the different step value to each row of GridUpDownColumn in SfDataGrid,

WPF: http://www.syncfusion.com/downloads/support/directtrac/138668/ze/WPF-213278894

 

 

 

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
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