Esempio n. 1
0
        public void BuildHeaderOnly(Template tmp)
        {
            var header = new ColumnHeaderSection();

            var height = GetHeight();

            header.Height = height > 0 ? height : header.Height;

            if (AutoLocationSet)
            {
                SetLocation();
            }

            var width = GetWidth();

            tmp.Width = width > 0 ? width : tmp.Width;

            foreach (var setting in Items)
            {
                SetHeaderRow(header, setting);
            }

            if (AllowHorizontalResize)
            {
                foreach (var cell in header.Cells)
                {
                    cell.ResizeMode = ResizeMode.Horizontal;
                }
            }

            tmp.ColumnHeaders.Add(header);
        }
Esempio n. 2
0
        private void SetHeaderRow(ColumnHeaderSection header, CellSetting setting)
        {
            HeaderCell chCell;

            if (setting.CellInstance is RowHeaderCell)
            {
                chCell = new CornerHeaderCell();
            }
            else
            {
                chCell = new ColumnHeaderCell();
            }
            //var chCell = new ColumnHeaderCell();
            chCell.Name     = string.Format("lbl{0}", setting.Name);
            chCell.Value    = setting.Caption;
            chCell.Size     = setting.Size;
            chCell.Location = setting.Location;
            var style = new CellStyle()
            {
                TextAlign = MultiRowContentAlignment.MiddleCenter,
                Multiline = MultiRowTriState.False,
                Font      = setting.Font ?? this.Font,
            };

            chCell.Style = style;

            if (chCell is ColumnHeaderCell)
            {
                var h = chCell as ColumnHeaderCell;
                if (this.Sortable)
                {
                    h.SelectionMode = MultiRowSelectionMode.None;
                    h.SortMode      = SortMode.Automatic;
                }
                else
                {
                    h.SortMode = SortMode.NotSortable;
                }

                if (setting.SortDropDown)
                {
                    h.DropDownContextMenuStrip = GetSortDropDownContextMenuStrip();
                }
                if (setting.DropDownList != null)
                {
                    h.DropDownList = setting.DropDownList;
                }
            }

            header.Cells.Add(chCell);
        }
Esempio n. 3
0
        public Template Build()
        {
            var template = new Template();
            var header   = new ColumnHeaderSection();
            var row      = new Row();

            if (AutoLocationSet)
            {
                SetLocation();
            }

            int height = GetHeight();

            header.Height = height > 0 ? height : header.Height;
            row.Height    = height > 0 ? height : row.Height;

            int width = GetWidth();

            template.Width = width > 0 ? width : template.Width;

            foreach (var setting in Items)
            {
                SetHeaderRow(header, setting);
                SetDetailRow(row, setting);
            }
            if (AllowHorizontalResize)
            {
                foreach (var cell in header.Cells)
                {
                    cell.ResizeMode = ResizeMode.Horizontal;
                }
            }
            template.ColumnHeaders.Add(header);
            template.Row = row;
            return(template);
        }
Esempio n. 4
0
 public override ColumnHeaderRow CreateColumnHeaderRow(ColumnHeaderSection parent)
 {
     return(new GroupingColumnHeaderRow(parent));
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new object in the specifed record part.
 /// </summary>
 /// <param name="parent">The parent element.</param>
 public GroupingColumnHeaderRow(ColumnHeaderSection parent)
     : base(parent)
 {
 }