Beispiel #1
0
        // Dennis: Creates a control for the Edit mode.

        protected override WebControl CreateEditModeControlCore()
        {
            ASPxColorEdit result = new ASPxColorEdit();

            RenderHelper.SetupASPxWebControl(result);
            return(result);
        }
    private object GetColor()
    {
        GridViewDataTextColumn col       = grid.Columns["DxColor"] as GridViewDataTextColumn;
        ASPxColorEdit          colorEdit = grid.FindEditRowCellTemplateControl(col, "colorEdit") as ASPxColorEdit;
        Color color = colorEdit.Color;

        return(color.ToArgb().ToString());
    }
Beispiel #3
0
        // Dennis: Creates a control for the View mode, because the default label does not meet our needs. We are almost fine with the ASPxColorEdit control, just need to make it readonly for the View mode.
        protected override WebControl CreateViewModeControlCore()
        {
            //base.CreateViewModeControlCore();
            ASPxColorEdit result = (ASPxColorEdit)CreateEditModeControlCore();

            result.DropDownButton.Visible           = false;
            result.DisabledStyle.Border.BorderColor = Color.Transparent;
            result.ReadOnly      = true;
            result.ClientEnabled = false;
            return(result);
        }
Beispiel #4
0
 // Dennis: Sets common options for the underlying controls.
 protected override void SetupControl(WebControl control)
 {
     base.SetupControl(control);
     if (control is ASPxColorEdit)
     {
         ASPxColorEdit result = (ASPxColorEdit)control;
         result.AllowNull          = AllowNull;
         result.AllowUserInput     = false; //Dennis: The control can display a hex value at the moment, so it is better to prevent user input by default. Track https://www.devexpress.com/issue=S33627.
         result.EnableCustomColors = true;
         result.ColorChanged      += new EventHandler(EditValueChangedHandler);
     }
 }
Beispiel #5
0
        public override System.Web.UI.Control Build()
        {
            base.Build();
            ASPxColorEdit ce = new ASPxColorEdit();

            ce.Width  = ModuleField.Width;
            ce.Height = ModuleField.Height;
            ce.ValidationSettings.RequiredField.IsRequired = ModuleField.IsRequired;
            ce.ValidationSettings.RequiredField.ErrorText  = ModuleField.ErrorText;
            ce.NullText = ModuleField.NullText;
            //CurrentValue值为App_ 表中的值;DefaultValue值为ModelField表中的值
            if (ModuleField.CurrentValue == null)
            {
                ce.Value = ModuleField.DefaultValue;
            }
            else
            {
                ce.Value = ModuleField.CurrentValue;
            }
            return(ce);
        }