Xceed Grid for WinForms v4.3 Documentation
NumericEditor

Welcome to Xceed Grid for WinForms v4.3 > Basic Concepts > CellEditorManagers and CellViewerManagers > How to use cell editors > NumericEditor

The NumericEditor can be used to edit the content of cells which have a numeric datatype.

Using the NumericEditor control

By default, the NumericEditor will be created as the CellEditorManager for all columns in the grid which have a numeric datatype. 

If a CellEditorManager other than the NumericEditor is desired by default for columns which have a numeric datatype, the GridControl's CellEditorManagerMapping property can be modified. For example:

VB.NET Copy Code
GridControl1.CellEditorManagerMapping( GetType( Integer) ) = New CustomNumericEditor()
C# Copy Code
gridControl1.CellEditorManagerMapping[ typeof( int) ] = new CustomNumericEditor();

If a different CellEditorManager is required for only one column or cell, the CellEditorManager property of the specific column or cell can be set rather than changing the default CellEditorManager that is created for all numeric columns via the CellEditorManagerMapping property.

VB.NET Copy Code
GridControl1.Columns( "Freight" ).CellEditorManager = New CustomNumericEditor()
C# Copy Code
gridControl1.Columns[ "Freight" ].CellEditorManager = new CustomNumericEditor();

Underlying control

The underlying control wrapped by the NumericEditor control is the WinNumericTextBox control and is accessible through the TemplateControl property. All settings relating to the underlying control must be accessed via the TemplateControl property. Note that if a cloned instance of the TemplateControl is used to edit (refer to the CreateControlMode property and CreateControl method), the actual control that is used will be a clone of the TemplateControl and not the TemplateControl itself. In this case, the ActivatingControl event can be used to modify the cloned instances. 

More information regarding the WinNumericTextBox control can be found in the WinNumericTextBox control topic.