コード例 #1
0
 protected override void RenderHeaderContent(CrossColumnDataSourceItem <THeaderKey, TRow, THeaderTable> column, HtmlTextWriter writer)
 {
     if (column.Column != null)
     {
         base.RenderHeaderContent(column, writer);
     }
     else
     {
         RenderTreeLink(column, writer);
     }
 }
コード例 #2
0
 protected virtual void InitHierarchy(ColumnHierarchy newItem, CrossColumnDataSourceItem item, Dictionary <string, ColumnHierarchy> existsColumns, Dictionary <string, BaseColumn> columnsDic)
 {
     if (newItem.ColumnName != null && !newItem.Delete)
     {
         columnsDic[newItem.ColumnName] = item.BaseColumn;
     }
     if (existsColumns.ContainsKey(newItem.ColumnKey))
     {
         newItem.Init(existsColumns[newItem.ColumnKey]);
     }
     InitedHierarchy(newItem, item, existsColumns, columnsDic);
 }
コード例 #3
0
        protected virtual void RenderTreeLink(CrossColumnDataSourceItem <THeaderKey, TRow, THeaderTable> column, HtmlTextWriter writer)
        {
            var postBack = HeaderControl.Page.ClientScript.GetPostBackClientHyperlink(
                HeaderControl.Journal,
                string.Format(
                    "FilterBy:{0}:Equals:{1}:{2}",
                    BaseFilterParameter.TreeStartLevelFilterName + typeof(THeaderTable).Name,
                    column.ColumnId,
                    column.Header));

            writer.AddAttribute(HtmlTextWriterAttribute.Href, postBack);
            writer.AddAttribute(HtmlTextWriterAttribute.Title, Resources.SFilterHeader);
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            base.RenderHeaderContent(column, writer);
            writer.RenderEndTag();
        }
コード例 #4
0
        protected void AddItems(THeaderTable row, List <CrossColumnDataSourceItem <THeaderKey, TRow, THeaderTable> > listItems, int level)
        {
            var item = new CrossColumnDataSourceItem <THeaderKey, TRow, THeaderTable>
            {
                Header         = GetColumnHeader(row),
                HeaderRu       = GetColumnHeaderRu(row),
                HeaderKz       = GetColumnHeaderKz(row),
                Childs         = new List <CrossColumnDataSourceItem <THeaderKey, TRow, THeaderTable> >(),
                ColumnId       = row.Id,
                Row            = row,
                BaseColumnName = BaseColumnName,
            };

            if (DicItems.ContainsKey(row.Id.ToString()))
            {
                if (SkipCircleInTree)
                {
                    return;
                }

                throw new Exception(
                          "Detect circle in cross header datasource. Exists: "
                          + string.Join(";", DicItems.Keys.Select(r => r.ToString()).ToArray()) + " try to add: "
                          + row.Id);
            }

            listItems.Add(item);
            DicItems[row.Id.ToString()] = item;

            if (FirstColumns)
            {
                AddColumns(row, item);
            }

            if (MaxRecursion > level && row.ChildObjects != null)
            {
                foreach (var childRow in FilterData(row.ChildObjects.AsQueryable(), null))
                {
                    AddItems(childRow, item.Childs, level + 1);
                }
            }

            if (!FirstColumns)
            {
                AddColumns(row, item);
            }
        }
コード例 #5
0
 protected override void InitHierarchy(HierarchyFields.ColumnHierarchy newItem, CrossColumnDataSourceItem item, Dictionary <string, HierarchyFields.ColumnHierarchy> existsColumns, Dictionary <string, BaseColumn> columnsDic)
 {
     newItem.IsTreeColumn = true;
     base.InitHierarchy(newItem, item, existsColumns, columnsDic);
 }
コード例 #6
0
 protected virtual void InitedHierarchy(ColumnHierarchy newItem, CrossColumnDataSourceItem item, Dictionary <string, ColumnHierarchy> existsColumns, Dictionary <string, BaseColumn> columnsDic)
 {
 }