Esempio n. 1
0
 private void InitializeRatingSpinEditor(
     RadSpinEditor spinEditor,
     GridViewRatingColumn ratingColumn)
 {
     spinEditor.Minimum       = (Decimal)ratingColumn.Minimum;
     spinEditor.Maximum       = (Decimal)ratingColumn.Maximum;
     spinEditor.Step          = new Decimal(1);
     spinEditor.DecimalPlaces = 1;
 }
Esempio n. 2
0
 private void InitializeSpinEditor(RadSpinEditor spinEditor, GridViewDecimalColumn decimalColumn)
 {
     spinEditor.Minimum            = decimalColumn.Minimum;
     spinEditor.Maximum            = decimalColumn.Maximum;
     spinEditor.Step               = decimalColumn.Step;
     spinEditor.DecimalPlaces      = (object)decimalColumn.DataType == (object)typeof(double) || (object)decimalColumn.DataType == (object)typeof(float) || ((object)decimalColumn.DataType == (object)typeof(Decimal) || (object)decimalColumn.DataType == (object)typeof(float)) ? decimalColumn.DecimalPlaces : 0;
     spinEditor.ThousandsSeparator = decimalColumn.ThousandsSeparator;
     spinEditor.ShowUpDownButtons  = decimalColumn.ShowUpDownButtons;
 }
Esempio n. 3
0
        private void InitializeSpinEditors()
        {
            RadSpinEditor spinEditor1 = new RadSpinEditor();
            RadSpinEditor spinEditor2 = new RadSpinEditor();

            this.rightEditor = (RadControl)spinEditor1;
            this.leftEditor  = (RadControl)spinEditor2;
            GridViewDecimalColumn column1 = this.column as GridViewDecimalColumn;
            GridViewRatingColumn  column2 = this.column as GridViewRatingColumn;

            if (column1 != null)
            {
                this.InitializeSpinEditor(spinEditor1, column1);
                this.InitializeSpinEditor(spinEditor2, column1);
            }
            else if (column2 != null)
            {
                this.InitializeRatingSpinEditor(spinEditor1, column2);
                this.InitializeRatingSpinEditor(spinEditor2, column2);
            }
            this.InitialEditorsSetup();
        }
Esempio n. 4
0
        private void SetupControlSpecificProperties(Control control, PropertyDescriptor property)
        {
            RadDropDownList radDropDownList = control as RadDropDownList;

            if (radDropDownList != null && property.PropertyType.IsEnum)
            {
                foreach (object obj in Enum.GetValues(property.PropertyType))
                {
                    RadListDataItem radListDataItem = new RadListDataItem(obj.ToString(), obj);
                    radDropDownList.Items.Add(radListDataItem);
                }
                radDropDownList.DropDownStyle = RadDropDownStyle.DropDownList;
            }
            RadSpinEditor radSpinEditor = control as RadSpinEditor;

            if (radSpinEditor == null)
            {
                return;
            }
            RadRangeAttribute radRangeAttribute = (RadRangeAttribute)null;

            foreach (Attribute attribute in property.Attributes)
            {
                if (attribute is RadRangeAttribute)
                {
                    radRangeAttribute = attribute as RadRangeAttribute;
                }
            }
            if (radRangeAttribute != null)
            {
                radSpinEditor.Minimum = (Decimal)radRangeAttribute.MinValue;
                radSpinEditor.Maximum = (Decimal)radRangeAttribute.MaxValue;
            }
            else
            {
                radSpinEditor.Minimum = new Decimal(int.MinValue);
                radSpinEditor.Maximum = new Decimal(int.MaxValue);
            }
        }
 public RadSpinEditorAccessibleObject(RadSpinEditor owner, string name)
     : base((Control)owner, name)
 {
     this.owner = owner;
 }
Esempio n. 6
0
 private void ValidateSpinEditor(RadSpinEditor spinEditor)
 {
     spinEditor?.SpinElement.Validate();
 }
 // Methods
 public RadSpinEditorAccessibleObject(RadSpinEditor owner)
     : base(owner)
 {
     this.owner = owner;
 }