Esempio n. 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);
     }
 }
 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);
 }
Esempio n. 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();
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
 }
 protected virtual void InitedHierarchy(ColumnHierarchy newItem, CrossColumnDataSourceItem item, Dictionary <string, ColumnHierarchy> existsColumns, Dictionary <string, BaseColumn> columnsDic)
 {
 }