Class GridNumericUpDownCellInfo
Defines a class that provides a new StyleInfoSubObjectBase object for customization of NumericUpDown cells.
Each property in this sub object can be configured individually. Properties that have not been initialized will inherit default values from a base style.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridNumericUpDownCellInfo : GridStyleInfoSubObject, ICustomTypeDescriptor, IDisposable, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject
Examples
The following code changes numeric up / down information for cells:
model.TableStyle.NumericUpDown = new GridNumericUpDownCellInfo(0, 25, 1, 1, true);
model[rowIndex, 1].Text = "NumericUpDown";
// Wrapping, Range 0-1000
model[rowIndex, 3].CellType = "NumericUpDown";
model[rowIndex, 3].NumericUpDown = new GridNumericUpDownCellInfo(0, 1000, 0, 1, true);
// Disabled
model[rowIndex, 4].CellType = "NumericUpDown";
model[rowIndex, 4].Enabled = false;
model[rowIndex, 4].Text = "5";
// No wrapping, Range 1-20
model[rowIndex, 5].CellType = "NumericUpDown";
model[rowIndex, 5].NumericUpDown = new GridNumericUpDownCellInfo(1, 20, 1, 1, false);
rowIndex++;
Constructors
GridNumericUpDownCellInfo()
Initializes a new instances of the GridNumericUpDownCellInfo class.
Declaration
public GridNumericUpDownCellInfo()
GridNumericUpDownCellInfo(StyleInfoSubObjectIdentity)
Initializes a new instances of the GridNumericUpDownCellInfo class that associates with an existing GridStyleInfoSubObjectIdentity.
Declaration
public GridNumericUpDownCellInfo(StyleInfoSubObjectIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoSubObjectIdentity | identity | A GridStyleInfoSubObjectIdentity that holds the identity for this GridNumericUpDownCellInfo. |
GridNumericUpDownCellInfo(StyleInfoSubObjectIdentity, GridNumericUpDownCellInfoStore)
Initializes a new instances of the GridNumericUpDownCellInfo class associates it with an existing GridStyleInfoSubObjectIdentity and GridNumericUpDownCellInfo.
Declaration
public GridNumericUpDownCellInfo(StyleInfoSubObjectIdentity identity, GridNumericUpDownCellInfoStore store)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoSubObjectIdentity | identity | A GridStyleInfoSubObjectIdentity that holds the identity for this GridNumericUpDownCellInfo. |
GridNumericUpDownCellInfoStore | store | A GridNumericUpDownCellInfoStore that holds data for this GridNumericUpDownCellInfo. All changes in this style object will be saved in the GridNumericUpDownCellInfoStore object. |
GridNumericUpDownCellInfo(Int32, Int32, Int32, Int32, Boolean)
Initializes a new instances of the GridNumericUpDownCellInfo class specified with the numeric up / down information.
Declaration
public GridNumericUpDownCellInfo(int min, int max, int start, int num, bool wrap)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | min | Minimum value. |
System.Int32 | max | Maximum value. |
System.Int32 | start | Start value. This is the first value when you press up or down in an empty cell. |
System.Int32 | num | The step to increase or decrease when clicking up or down buttons. |
System.Boolean | wrap | IfTrueValues should start over when the value reaches maximum or minimum. |
Examples
This example shows how to use the GridNumericUpDownCellInfo(Int32, Int32, Int32, Int32, Boolean) method.
this.gridControl1.TableStyle.NumericUpDown = new GridNumericUpDownCellInfo(0, 1000, 5, 5, false);
Me.gridControl1.TableStyle.NumericUpDown = New GridNumericUpDownCellInfo(0, 1000, 5, 5, False)
Properties
ArrowColor
Gets or sets the arrow fore color of Up and Down buttons.
Declaration
public Color ArrowColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
BackColor
Gets or sets the background color of Up and Down buttons in normal state.
Declaration
public Color BackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
BorderColor
Gets or sets the border color of Up and Down buttons in normal state.
Declaration
public Color BorderColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Default
Gets the default value GridNumericUpDownCellInfo to be used with a default style.
Declaration
public static GridNumericUpDownCellInfo Default { get; }
Property Value
Type |
---|
GridNumericUpDownCellInfo |
Remarks
The Default of the GridStyleInfo class will return the default numeric up / down info that this method generates through its overridden version of GetDefaultStyle().
Default settings are:
Property | Value |
---|---|
Minimum | 0 |
Maximum | int.MaxValue |
WrapValue | false |
Step | 1 |
StartValue | 0 |
HasMaximum
Gets a value indicating whether Maximum property is initialized.
Declaration
public bool HasMaximum { get; }
Property Value
Type |
---|
System.Boolean |
HasMinimum
Gets a value indicating whether the Minimum property is initialized.
Declaration
public bool HasMinimum { get; }
Property Value
Type |
---|
System.Boolean |
HasStartValue
Gets a value indicating whether StartValue property is initialized.
Declaration
public bool HasStartValue { get; }
Property Value
Type |
---|
System.Boolean |
HasStep
Gets a value indicating whether the Step property is initialized.
Declaration
public bool HasStep { get; }
Property Value
Type |
---|
System.Boolean |
HasWrapValue
Gets a value indicating whether WrapValue property is initialized.
Declaration
public bool HasWrapValue { get; }
Property Value
Type |
---|
System.Boolean |
HoverBackColor
Gets or sets the background color of Up and Down buttons in hover state.
Declaration
public Color HoverBackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
HoverBorderColor
Gets or sets the border color of Up and Down buttons in hover state.
Declaration
public Color HoverBorderColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Maximum
Gets or sets the maximum value.
Declaration
public int Maximum { get; set; }
Property Value
Type |
---|
System.Int32 |
Minimum
Gets or sets the minimum value.
Declaration
public int Minimum { get; set; }
Property Value
Type |
---|
System.Int32 |
PressedBackColor
Gets or sets the background color of Up and Down buttons in pressed state.
Declaration
public Color PressedBackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
PressedBorderColor
Gets or sets the border color of Up and Down buttons in pressed state.
Declaration
public Color PressedBorderColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
StartValue
Gets or sets the start value. This is the first value when you press up or down in an empty cell.
Declaration
public int StartValue { get; set; }
Property Value
Type |
---|
System.Int32 |
Step
Gets or sets the step value to increase or decrease when clicking up or down buttons.
Declaration
public int Step { get; set; }
Property Value
Type |
---|
System.Int32 |
WrapValue
Gets or sets a value indicating whether to wrap or not. True if value should be starting over when value reaches maximum or minimum.
Declaration
public bool WrapValue { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | IfTrueThe values should starts over when it reaches the maximum or minimum value. |
Methods
GetDefaultStyle()
Overrides and gets the default style object for your derived class.
Declaration
protected override StyleInfoBase GetDefaultStyle()
Returns
Type | Description |
---|---|
StyleInfoBase | A default style object. |
Overrides
MakeCopy(StyleInfoBase, StyleInfoProperty)
Overrides and creates an exact copy of the current object.
Declaration
public override IStyleInfoSubObject MakeCopy(StyleInfoBase newOwner, StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoBase | newOwner | The new owner style object for the copied object. |
StyleInfoProperty | sip | An identifier for this object. |
Returns
Type | Description |
---|---|
IStyleInfoSubObject | Copied object. |
Overrides
ResetMaximum()
Resets the Maximum property.
Declaration
public void ResetMaximum()
ResetMinimum()
Resets the Minimum property.
Declaration
public void ResetMinimum()
ResetStartValue()
Resets the StartValue property.
Declaration
public void ResetStartValue()
ResetStep()
Resets the Step property.
Declaration
public void ResetStep()
ResetWrapValue()
Resets the WrapValue property.
Declaration
public void ResetWrapValue()