Type of object that is used to wrap the
Value property.
Syntax
Remarks
Example
The DataMode property allows to define object that is used to get/set the Value property of the WebNumericEdit.
| Visual Basic | Copy 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
Me.WebNumericEdit1.DataMode = Infragistics.WebUI.WebDataInput.NumericDataMode.Int
Me.WebNumericEdit1.Value = 123
Dim value2 As Integer = Me.WebNumericEdit1.Value
Me.WebCurrencyEdit1.DataMode = Infragistics.WebUI.WebDataInput.NumericDataMode.Text
Me.WebCurrencyEdit1.Value = "123"
Dim value2 As String = Me.WebCurrencyEdit1.Value
Me.WebCurrencyEdit1.NullText = "None"
Me.WebNumericEdit1.Nullable = False
Me.WebNumericEdit1.MinValue = 10.0
Me.WebNumericEdit1.MaxValue = 99.0
Me.WebNumericEdit1.SpinButtons.Display = Infragistics.WebUI.WebDataInput.ButtonDisplay.OnLeft
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