Beispiel #1
0
 public void PrepareFLGroup(LayoutGroup group, bool isOptionFormLayout, ControlOptionsSettings?settings)
 {
     if (isOptionFormLayout)
     {
         group.GroupBoxDecoration = GroupBoxDecoration.HeadingLine;
         group.Height             = Unit.Percentage(100d);
     }
     if (settings != null)
     {
         var optionsValue              = settings.Value;
         int layoutGroupMaxWidth       = 1240;
         int maxLayoutColumnsInGroup   = layoutGroupMaxWidth / optionsValue.ColumnMinWidth;
         LayoutBreakpoints breakpoints = group.GridSettings.Breakpoints;
         if (optionsValue.ColumnMinWidth != 0 && optionsValue.ColumnCountMode == RecalculateColumnCountMode.ChildGroups && breakpoints.IsEmpty)
         {
             int itemsCount = 10;
             if (isOptionFormLayout)
             {
                 itemsCount        = maxLayoutColumnsInGroup;
                 group.ColumnCount = maxLayoutColumnsInGroup;
             }
             for (int i = 0; i < itemsCount; i++)
             {
                 int breakpointMaxWidth = (i + 2) * optionsValue.ColumnMinWidth;
                 breakpoints.Add(new LayoutBreakpoint(i.ToString(), breakpointMaxWidth, i + 1));
             }
         }
         group.GridSettings.StretchLastItem    = DefaultBoolean.False;
         group.GridSettings.WrapCaptionAtWidth = optionsValue.ColumnMinWidth;
     }
 }
Beispiel #2
0
 private void PrepareFormLayout(ASPxFormLayout formLayout, bool isOptionFormLayout, ControlOptionsSettings?settings = null)
 {
     if (settings != null)
     {
         var optionsValue = settings.Value;
         if (optionsValue.ColumnMinWidth != 0)
         {
             LayoutBreakpoints breakpoints = formLayout.SettingsAdaptivity.GridSettings.Breakpoints;
             if (optionsValue.ColumnCountMode == RecalculateColumnCountMode.RootGroup && breakpoints.IsEmpty)
             {
                 for (int i = 0; i < 10; i++)
                 {
                     breakpoints.Add(new LayoutBreakpoint(i.ToString(), ((i + 2) * optionsValue.ColumnMinWidth), i + 1));
                 }
             }
             formLayout.SettingsAdaptivity.GridSettings.StretchLastItem = DefaultBoolean.True;
         }
         if (optionsValue.RightBlockWidth != 0)
         {
             ControlOptionsRightBlockWidth = Unit.Pixel(optionsValue.RightBlockWidth);
         }
     }
     formLayout.ForRootChildGroups(group => PrepareFLGroup(group, isOptionFormLayout, settings));
     AppyCssClassesForFormLayout(formLayout);
     ApplySettingsForFormLayout(formLayout);
     if (isOptionFormLayout)
     {
         formLayout.Theme = Theme;
     }
     formLayout.ForEach(itemBase => PrepareFLItem(itemBase, isOptionFormLayout));
 }