Using float or double in Numericupdown

It seems only int data can be used with NumericUpDown cell type in GridControl,
Is there any way to use floating data in Numericupdown cell type?

1 Reply

JJ Jisha Joy Syncfusion Team July 1, 2009 05:02 AM UTC

Hi Elaiyaraja,

You need to use a custom celltype to achieve the desired behavior. In general, a cell type requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell, such as drawing and handling mouse actions. Please refer the following sample form our sample browser that shows this.

..\my documents\syncfusion\essentialstudio\7.2.0.20\Windows\Grid.Windows\Samples\2.0\Custom Cell Type\Enhanced Numeric Up-Down Cell Demo\cs

It is having the following features:

Features:

Up and down buttons are associated with the control and let the user increase or decrease numeric values

An enhanced UpDown control allows decimal increments and decrements and has options to decrease the number beyond zero

It also allows increments and decrements via the arrow keys from keyboard

Two classes that play a major role in creating the UpDown controls are the EnhancedUpDownButton class and the FloatNumericUpDownStyleProperties class

EnhancedUpDownButton class inherits the GridCellUpDownButton class and is used to create up-down buttons in grid cells

The FloatNumericUpDownStyleProperties class defines necessary style properties for the customization of an up-down cell

Please let me know if this helps.

Regards,
Jisha

Loader.
Up arrow icon