private void SetEditorValue(object value) { RadSpinElement spinEditor = this.EditorElement as RadSpinElement; if (value == null) { spinEditor.Text = String.Empty; return; } try { Decimal convertedValue = Convert.ToDecimal(value); if (convertedValue < spinEditor.MinValue) { convertedValue = spinEditor.MinValue; } else if (convertedValue > spinEditor.MaxValue) { convertedValue = spinEditor.MaxValue; } spinEditor.Value = convertedValue; } catch { try { spinEditor.Value = decimal.Parse(value.ToString()); } catch { spinEditor.Value = spinEditor.MinValue; } } }
public override void Initialize(object owner, object value) { RadSpinElement editorElement = this.EditorElement as RadSpinElement; editorElement.MaxValue = new Decimal(int.MaxValue); editorElement.MinValue = new Decimal(int.MinValue); base.Initialize(owner, value); }
private object GetEditorValue() { RadSpinElement editorElement = this.EditorElement as RadSpinElement; editorElement.Validate(); if (string.IsNullOrEmpty(editorElement.Text)) { return((object)null); } return((object)editorElement.Value); }
/// <summary> /// CreateChildItems /// </summary> /// <param name="parent"></param> protected override void CreateChildItems(RadElement parent) { this.spinElement = new RadSpinElement(); this.spinElement.RightToLeft = this.RightToLeft == RightToLeft.Yes; this.RootElement.Children.Add(spinElement); this.RootElement.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren; base.CreateChildItems(parent); this.spinElement.ValueChanging += new ValueChangingEventHandler(spinElement_ValueChanging); this.spinElement.ValueChanged += new EventHandler(spinElement_ValueChanged); }
protected override void CreateChildItems(RadElement parent) { this.spinElement = this.CreateSpinElement(); this.spinElement.RightToLeft = this.RightToLeft == RightToLeft.Yes; this.RootElement.Children.Add((RadElement)this.spinElement); this.spinElement.ValueChanging += new ValueChangingEventHandler(this.spinElement_ValueChanging); this.spinElement.ValueChanged += new EventHandler(this.spinElement_ValueChanged); this.spinElement.TextChanged += new EventHandler(this.spinElement_TextChanged); this.spinElement.KeyDown += new KeyEventHandler(this.OnSpinElementKeyDown); this.spinElement.KeyPress += new KeyPressEventHandler(this.OnSpinElementKeyPress); this.spinElement.KeyUp += new KeyEventHandler(this.OnSpinElementKeyUp); }
public override void InitializeEditor(IInputEditor editor) { GridSpinEditor gridSpinEditor = editor as GridSpinEditor; if (gridSpinEditor == null) { return; } RadSpinElement editorElement = (RadSpinElement)gridSpinEditor.EditorElement; editorElement.DecimalPlaces = GridViewHelper.IsInteger(this.DataType) || GridViewHelper.IsIntegerSql(this.DataType) ? 0 : this.DecimalPlaces; gridSpinEditor.ValueType = this.DataType; editorElement.ShowUpDownButtons = this.ShowUpDownButtons; editorElement.Step = this.Step; editorElement.MinValue = this.Minimum; editorElement.MaxValue = this.Maximum; editorElement.ThousandsSeparator = this.ThousandsSeparator; }
private void SetEditorValue(object value) { RadSpinElement editorElement = this.EditorElement as RadSpinElement; if (value == null) { editorElement.Text = string.Empty; } else { Decimal num = Convert.ToDecimal(value); if (num < editorElement.MinValue) { num = editorElement.MinValue; } else if (num > editorElement.MaxValue) { num = editorElement.MaxValue; } editorElement.Value = num; } }
private string GetNumberText() { return(RadSpinElement.GetNumberText(this.Value, this.Hexadecimal, this.ThousandsSeparator, this.DecimalPlaces)); }
protected virtual string GetNumberText(Decimal num) { return(RadSpinElement.GetNumberText(num, this.Hexadecimal, this.ThousandsSeparator, this.DecimalPlaces)); }
public RadSpinEditorElementAccessibleObject(RadSpinElement owner) { this.owner = owner; }