public ICollection GenerateFields(Control control)
        {
            var itemControl = control as IDataBoundItemControl;
            var containerType = 
                ((!(control is IDataBoundListControl) && !(control is Repeater)) && (control is IDataBoundItemControl)) ?
                ContainerType.Item :
                ContainerType.List;
            var mode = itemControl?.Mode ?? DataBoundControlMode.ReadOnly;

            var columns = _table.GetScaffoldColumns(mode, containerType);
            
            return SortColumns(_table, columns)
                .Select(col => {
                    var field = new DynamicField()
                    {
                        DataField = col.Name,
                        HeaderText = (containerType == ContainerType.List) ? col.ShortDisplayName : col.Name
                    };
                    if (containerType != ContainerType.List)
                    {
                        field.ItemStyle.BorderWidth = 0;
                    }
                    field.ItemStyle.Wrap = false;
                    return field;
                })
                .ToList();
        }
        protected virtual DynamicField CreateField(MetaColumn column, ContainerType containerType, DataBoundControlMode mode) {            
            string headerText = (containerType == ContainerType.List ? column.ShortDisplayName : column.DisplayName);

            var field = new DynamicField() {
                DataField = column.Name,
                HeaderText = headerText
            };
            // Turn wrapping off by default so that error messages don't show up on the next line.
            field.ItemStyle.Wrap = false;

            return field;
        }
예제 #3
0
 //-------------------------------------------------------------------------------------------
 private void SetSelectedColumns()
 {
     _filteredFieldsManager.SelectedColumns.Clear();
       foreach (ListItem listItem in Columns.Items)
       {
            if (listItem.Selected)
            {
                 var f = new DynamicField();
                 f.DataField = listItem.Value;
                 _filteredFieldsManager.SelectedColumns.Add(f);
            }
       }
 }
예제 #4
0
			public ICollection GenerateFields (Control ctl)
			{
				var ret = new List <DynamicField> ();
				foreach (MetaColumn column in table.Columns) {
					if (!column.Scaffold)
						continue;
					
					var field = new DynamicField ();
					field.DataField = column.Name;
					ret.Add (field);
				}
				
				return ret;
			}
예제 #5
0
 public ICollection GenerateFields( Control control )
 {
     List<DynamicField> list = new List<DynamicField>();
     foreach( MetaColumn column in this._columns )
     {
         if( ( column.Scaffold && ( !column.IsLongString || !( control is GridView ) ) ) && ( ( this._mode != DataBoundControlMode.Insert ) || !( column is MetaChildrenColumn ) ) )
         {
             DynamicField item = new DynamicField();
             item.DataField = column.Name;
             list.Add( item );
         }
     }
     return list;
 }
        protected virtual DynamicField CreateField(MetaColumn column, ContainerType containerType, DataBoundControlMode mode)
        {
            string headerText = (containerType == ContainerType.List ? column.ShortDisplayName : column.DisplayName);

            var field = new DynamicField()
            {
                DataField  = column.Name,
                HeaderText = headerText
            };

            // Turn wrapping off by default so that error messages don't show up on the next line.
            field.ItemStyle.Wrap = false;

            return(field);
        }
        /// <summary>
        /// See base class documentation
        /// </summary>
        protected override void CopyProperties(DataControlField newField)
        {
            base.CopyProperties(newField);
            DynamicField field = ((DynamicField)newField);

            field.DataField                = DataField;
            field.ApplyFormatInEditMode    = ApplyFormatInEditMode;
            field.ConvertEmptyStringToNull = ConvertEmptyStringToNull;
            field.HtmlEncode               = HtmlEncode;
            field.ReadOnly         = ReadOnly;
            field.NullDisplayText  = NullDisplayText;
            field.UIHint           = UIHint;
            field.ValidationGroup  = ValidationGroup;
            field.DataFormatString = DataFormatString;
        }
예제 #8
0
            public ICollection GenerateFields(Control ctl)
            {
                var ret = new List <DynamicField> ();

                foreach (MetaColumn column in table.Columns)
                {
                    if (!column.Scaffold)
                    {
                        continue;
                    }

                    var field = new DynamicField();
                    field.DataField = column.Name;
                    ret.Add(field);
                }

                return(ret);
            }
예제 #9
0
        //-------------------------------------------------------------------------------------------
        public FilteredFieldsManager(MetaTable table, PageTemplate currentPage)
        {
            _table = table;
               _currentPage = currentPage;

               foreach (var column in _table.Columns)
               {
                    // carry on the loop at the next column
                    // if scaffold table is set to false or DenyRead
                    if (!column.Scaffold ||
                         column.IsLongString ||
                         column.ColumnIsInPage(_currentPage))
                         continue;

                    var f = new DynamicField();

                    f.DataField = column.Name;
                    _selectedColumns.Add(f);
               }
        }
        public ICollection GenerateFields(Control control)
        {
            var fields = new List<DynamicField>();

            foreach (var column in _table.Columns)
            {
                // carry on the loop at the next column  if scaffold table is set to false or DenyRead
                if (!column.Scaffold || IsHidden(column))
                {
                    //column.IsLongString ||
                    continue;
                }

                var dynamicField = new DynamicField();
                dynamicField.DataField = column.Name;

                fields.Add(dynamicField);
            }

            return fields;
        }
    public ICollection GenerateFields(Control control)
    {
        var oFields = new List<DynamicField>();

        foreach (var column in _table.Columns)
        {
            // carry on the loop at the next column
            // if scaffold table is set to false or DenyRead
            if (!column.Scaffold ||
                column.IsLongString ||
                column.IsHidden(_currentPage))
                continue;

            var f = new DynamicField();

            f.DataField = column.Name;
            oFields.Add(f);
        }
        return oFields;
    }