Class GridCurrencyTextBoxCellModel
Implements the data / model part for a Currency cell.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridCurrencyTextBoxCellModel : GridStaticCellModel, ISerializable, IDisposable
Remarks
You typically access cell models through the CellModels property of the GridModel class.
A GridCurrencyTextBoxCellModel can serve as model for several GridCurrencyTextBoxCellRenderer instances if there are several GridControlBase views for a GridModel.
See GridCurrencyTextBoxCellRenderer for more detailed information about this cell type.
Constructors
GridCurrencyTextBoxCellModel(GridModel)
Initializes a new GridCurrencyTextBoxCellModel object and stores a reference to the GridModel this cell belongs to.
Declaration
public GridCurrencyTextBoxCellModel(GridModel grid)
Parameters
Type | Name | Description |
---|---|---|
GridModel | grid | The GridModel for this cell model. |
Remarks
You typically access cell models through the CellModels property of the GridModel class.
GridCurrencyTextBoxCellModel(SerializationInfo, StreamingContext)
Initializes a new GridCurrencyTextBoxCellModel from a serialization stream.
Declaration
protected GridCurrencyTextBoxCellModel(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or de_serialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Properties
ValidateNumberDuringCellPaste
Gets or sets a value indicating whether Clipboard text is validated before a paste.
Declaration
public bool ValidateNumberDuringCellPaste { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
If ValidateNumberDuringCellPaste is true, then when a paste operation is preformed on an active cell, the paste will only be attempted if the text on the Clipboard is valid.
Methods
ApplyFormattedText(GridStyleInfo, String, Int32)
Parses the display text and converts it into a cell value to be stored in the style object. GridStyleInfo.CultureInfo is used for parsing the string.
Declaration
public override bool ApplyFormattedText(GridStyleInfo style, string text, int textInfo)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | Style information for the cell. |
System.String | text | The input text to be parsed. |
System.Int32 | textInfo | TextInfo is a hint of who is calling, default is GridCellBaseTextInfo.DisplayText |
Returns
Type | Description |
---|---|
System.Boolean | True if value was parsed correctly and saved in style object as CellValue; False otherwise. |
Overrides
ApplyText(GridStyleInfo, String)
Parses the text and converts it into a cell value to be stored in the style object (ignoring any Format settings). CultureInfo.CurrentText is used for parsing the string.
Declaration
public override bool ApplyText(GridStyleInfo style, string text)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
System.String | text | The input text to be parsed. |
Returns
Type | Description |
---|---|
System.Boolean | True if value was parsed correctly and saved in style object as CellValue; False otherwise. |
Overrides
CreateRenderer(GridControlBase)
Creates cell renderer.
Declaration
public override GridCellRendererBase CreateRenderer(GridControlBase control)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | control |
Returns
Type | Description |
---|---|
GridCellRendererBase | Currency TextBox cell renderer. |
Overrides
Dispose(Boolean)
Set null value for currencyTextBox.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Overrides
Remarks
See the documentation for the System.ComponentModel.Component class and its Dispose member.
GetDisplayTextAndColor(GridStyleInfo, Object, out Color)
Returns the text as it is displayed in the cell (without '-' sign) and also the text color.
Declaration
public string GetDisplayTextAndColor(GridStyleInfo style, object value, out Color textColor)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The style information. |
System.Object | value | The value. |
System.Drawing.Color | textColor | Returns the text color for the cell (depending on whether value is negative or positive). |
Returns
Type | Description |
---|---|
System.String | The text as it is displayed in the cell. |
GetFormattedText(GridStyleInfo, Object, Int32)
This is called from GridStyleInfo.GetFormattedText.
Declaration
public override string GetFormattedText(GridStyleInfo style, object value, int textInfo)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
System.Object | value | The value to format. |
System.Int32 | textInfo | TextInfo is a hint of who is calling, default is GridCellBaseTextInfo.DisplayText. |
Returns
Type | Description |
---|---|
System.String | The formatted text for the given value. |
Overrides
GetText(GridStyleInfo, Object)
This is called from GridStyleInfo.GetText (ignoring any Format settings).
Declaration
public override string GetText(GridStyleInfo style, object value)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
System.Object | value | The value to convert to a string. |
Returns
Type | Description |
---|---|
System.String | The string that represents the given value. |
Overrides
InitCurrencyEditProperties(CurrencyTextBox, GridStyleInfo)
Initializes a CurrencyTextBox with information supplied by a GridStyleInfo.
Declaration
public static void InitCurrencyEditProperties(CurrencyTextBox mb, GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
CurrencyTextBox | mb | The control to be initialized. |
GridStyleInfo | style | The style with settings to be applied. |