Infragistics2.WebUI.WebDataInput.v7.3
DataMode Property
See Also  Example
Infragistics.WebUI.WebDataInput Namespace > WebNumericEdit Class : DataMode Property

Type of object that is used to wrap the Value property.

Syntax

Visual Basic (Declaration) 
Public Property DataMode As NumericDataMode
C# 
public NumericDataMode DataMode {get; set;}

Remarks

Default value is set to the Double.

That property is designed to be used when this editor is embedded into grid or other control.

Example

The DataMode property allows to define object that is used to get/set the Value property of the WebNumericEdit.

Visual BasicCopy Code
Protected WithEvents WebCurrencyEdit1 As Infragistics.WebUI.WebDataInput.WebCurrencyEdit
Protected WithEvents WebNumericEdit1 As Infragistics.WebUI.WebDataInput.WebNumericEdit

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If Me.Page.IsPostBack Then Return
    ' Note: any change of any property at run time increases size of
    ' the hidden viewstate passed to client.
    '
    ' Configure WebNumericEdit1 to use the int (Int32) for the Value property
    Me.WebNumericEdit1.DataMode = Infragistics.WebUI.WebDataInput.NumericDataMode.Int
    ' Set number in control to the 123
    Me.WebNumericEdit1.Value = 123
    ' Following line will be valid and the value1 will contain
    ' the Integer object rather than the default Double
    Dim value2 As Integer = Me.WebNumericEdit1.Value
    '
    ' Configure WebCurrencyEdit1 to use the String for the Value property
    Me.WebCurrencyEdit1.DataMode = Infragistics.WebUI.WebDataInput.NumericDataMode.Text
    ' Set number in control to the 123
    Me.WebCurrencyEdit1.Value = "123"
    ' Following line will be valid and the value2 will contain
    ' the String object rather than the default Double
    Dim value2 As String = Me.WebCurrencyEdit1.Value
    '
    ' Modify text that dispayed when WebCurrencyEdit1 has null value
    Me.WebCurrencyEdit1.NullText = "None"
    '
    ' Do not allow null value in
    Me.WebNumericEdit1.Nullable = False
    '
    ' Set min and max limits
    Me.WebNumericEdit1.MinValue = 10.0
    Me.WebNumericEdit1.MaxValue = 99.0
    '
    ' Show spin buttons
    Me.WebNumericEdit1.SpinButtons.Display = Infragistics.WebUI.WebDataInput.ButtonDisplay.OnLeft
    '
    ' Show 4 at least digits after decimal point
    Me.WebNumericEdit1.MinDecimalPlaces = 4
End Sub
C#Copy Code
protected Infragistics.WebUI.WebDataInput.WebCurrencyEdit WebCurrencyEdit1; 
protected Infragistics.WebUI.WebDataInput.WebNumericEdit WebNumericEdit1; 
 
private void Page_Load(object sender, System.EventArgs e) 

    if(this.Page.IsPostBack) 
        return; 
    // Note: any change of any property at run time increases size of 
    // the hidden viewstate passed to client. 
    // 
    // Configure WebNumericEdit1 to use the int (Int32) for the Value property 
    this.WebNumericEdit1.DataMode = Infragistics.WebUI.WebDataInput.NumericDataMode.Int; 
    // Set number in control to the 123 
    this.WebNumericEdit1.Value = 123; 
    // Following line will be valid and the value1 will contain 
    // the int object rather than the default double 
    int value1 = (int)this.WebNumericEdit1.Value; 
    // 
    // Configure WebCurrencyEdit1 to use the String for the Value property 
    this.WebCurrencyEdit1.DataMode = Infragistics.WebUI.WebDataInput.NumericDataMode.Text; 
    // Set number in control to the 123 
    this.WebCurrencyEdit1.Value = "123"; 
    // Following line will be valid and the value2 will contain 
    // the string object rather than the default double 
    string value2 = (string)this.WebCurrencyEdit1.Value; 
    // 
    // Modify text that dispayed when WebCurrencyEdit1 has null value 
    this.WebCurrencyEdit1.NullText = "None"; 
    // 
    // Do not allow null value in  
    this.WebNumericEdit1.Nullable = False; 
    // 
    // Set min and max limits 
    this.WebNumericEdit1.MinValue = 10.0; 
    this.WebNumericEdit1.MaxValue = 99.0; 
    // 
    // Show spin buttons 
    this.WebNumericEdit1.SpinButtons.Display = Infragistics.WebUI.WebDataInput.ButtonDisplay.OnLeft; 
    // 
    // Show 4 at least digits after decimal point 
    this.WebNumericEdit1.MinDecimalPlaces = 4; 

 

See Also