Exemple #1
0
 /// <summary>設定FormLayout-Item-DateEdit</summary>
 /// <param name="i"></param>
 /// <param name="isReadOnly"></param>
 public static void SetDateEdit(MVCxFormLayoutItem i, bool isReadOnly = false)
 {
     i.NestedExtension().DateEdit(s =>
     {
         if (isReadOnly)
         {
             s.ReadOnly = true;
             s.ControlStyle.CssClass                = "DisableEditor";
             s.ControlStyle.BackColor               = System.Drawing.Color.Beige;
             s.Properties.ButtonStyle.BackColor     = System.Drawing.Color.Beige;
             s.Properties.DropDownButton.Enabled    = false;
             s.Properties.ClientSideEvents.GotFocus = "function(s, e) { s.HideDropDown(); }";
         }
         else
         {
             s.Properties.ClientSideEvents.GotFocus = "function(s, e) { s.ShowDropDown(); }";
         }
         s.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithTooltip;
         s.ShowModelErrors = true;
         //s.Width = Unit.Percentage(100);
         s.Properties.EditFormat          = EditFormat.Custom;
         s.Properties.EditFormatString    = "yyyy/MM/dd";
         s.Properties.DisplayFormatString = "yyyy/MM/dd";
     });
 }
Exemple #2
0
        /// <summary> 設定Search-FormLayout-Item-ComboBox </summary>
        /// <param name="i"></param>
        /// <param name="valueField"></param>
        /// <param name="textField"></param>
        /// <param name="dataSource"></param>
        public static void SetSearchComboBox(MVCxFormLayoutItem i, string valueField, string textField, object dataSource)
        {
            SetComboBox(i, valueField, textField, dataSource);

            i.NestedExtension().ComboBox(s =>
            {
                s.Properties.ClearButton.DisplayMode = ClearButtonDisplayMode.OnHover;
            });
        }
Exemple #3
0
 /// <summary>設定FormLayout-Item-Memo</summary>
 /// <param name="i"></param>
 /// <param name="rows"></param>
 /// <param name="isReadOnly"></param>
 public static void SetMemo(MVCxFormLayoutItem i, int rows = 1, bool isReadOnly = false)
 {
     i.NestedExtension().Memo(s =>
     {
         if (isReadOnly)
         {
             s.ReadOnly = true;
             s.ControlStyle.CssClass  = "DisableEditor";
             s.ControlStyle.BackColor = System.Drawing.Color.Beige;
         }
         s.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithTooltip;
         s.ShowModelErrors = true;
         s.Properties.Rows = rows;
     });
 }
Exemple #4
0
        /// <summary>設定FormLayout-Item-Textbox</summary>
        /// <param name="i"></param>
        /// <param name="isReadOnly"></param>
        public static void SetTextBox(MVCxFormLayoutItem i, bool isReadOnly = false)
        {
            i.NestedExtension().TextBox(s =>
            {
                if (isReadOnly)
                {
                    s.ReadOnly = true;
                    s.ControlStyle.CssClass  = "DisableEditor";
                    s.ControlStyle.BackColor = System.Drawing.Color.Beige;
                }
                s.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithTooltip;
                s.ShowModelErrors = true;

                //s.Width = Unit.Percentage(100);
            });
        }
Exemple #5
0
 /// <summary>設定FormLayout-Item-RadioButtonList</summary>
 /// <param name="i"></param>
 /// <param name="isReadOnly"></param>
 public static void SetRadioButtonList(MVCxFormLayoutItem i, List <ListEditItem> items, bool isReadOnly = false)
 {
     i.NestedExtension().RadioButtonList(s =>
     {
         if (isReadOnly)
         {
             s.ReadOnly = true;
             s.ControlStyle.CssClass  = "DisableEditor";
             s.ControlStyle.BackColor = System.Drawing.Color.Beige;
         }
         s.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithTooltip;
         s.ShowModelErrors            = true;
         s.Properties.RepeatDirection = RepeatDirection.Horizontal;
         //s.Width = Unit.Percentage(100);
         s.Properties.Items.AddRange(items);
     });
 }
Exemple #6
0
        /// <summary> >設定FormLayout-Item-SpinEdit </summary>
        /// <param name="i"></param>
        /// <param name="decimalPlaces"></param>
        /// <param name="isReadOnly"></param>
        public static void SetSpinEdit(MVCxFormLayoutItem i, int decimalPlaces = 2, bool isReadOnly = false)
        {
            i.NestedExtension().SpinEdit(s =>
            {
                if (isReadOnly)
                {
                    s.ReadOnly = true;
                    s.ControlStyle.CssClass            = "DisableEditor";
                    s.ControlStyle.BackColor           = System.Drawing.Color.Beige;
                    s.Properties.ButtonStyle.BackColor = System.Drawing.Color.Beige;
                }
                s.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithTooltip;
                s.ShowModelErrors = true;

                s.Properties.DisplayFormatString     = "G29";
                s.Properties.DecimalPlaces           = decimalPlaces;
                s.Properties.DisplayFormatInEditMode = true;
            });
        }
Exemple #7
0
 /// <summary>設定FormLayout-Item-ComboBox</summary>
 /// <param name="i"></param>
 /// <param name="valueField"></param>
 /// <param name="textField"></param>
 /// <param name="dataSource"></param>
 /// <param name="isReadOnly"></param>
 public static void SetComboBox(MVCxFormLayoutItem i, string valueField, string textField, object dataSource, bool isReadOnly = false)
 {
     i.NestedExtension().ComboBox(s =>
     {
         if (isReadOnly)
         {
             s.ReadOnly = true;
             s.ControlStyle.BackColor           = System.Drawing.Color.Beige;
             s.Properties.ButtonStyle.BackColor = System.Drawing.Color.Beige;
             s.ControlStyle.CssClass            = "DisableEditor";
         }
         s.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithTooltip;
         s.ShowModelErrors = true;
         //s.Width = Unit.Percentage(100);
         s.Properties.ValueField = valueField;
         s.Properties.TextField  = textField;
         s.Properties.DataSource = dataSource;
     });
 }