private ComponentArt.Web.UI.GridColumn GetColumn(GridColumnInfo info) { ComponentArt.Web.UI.GridColumn column = new ComponentArt.Web.UI.GridColumn { DataField = info.GridColumnName, HeadingText = (string.IsNullOrEmpty(info.Caption) ? info.PropertyName : info.Caption) }; Type type = info.CreateType(); if (type.IsEnum || (info.CellViewerManager == "Combo" || info.CellViewerManager == "MultiCombo")) { column.DataType = typeof(string); } else { column.DataType = type; } string fs = Feng.Utils.DataProcess.GetFormatString(info); if (!string.IsNullOrEmpty(fs)) { column.FormatString = fs; } return(column); }
private void CreateColumns(int level, WindowTabInfo tabInfo) { string gridName = tabInfo.GridName; //"网页查询_客户委托情况_进口"; foreach (GridColumnInfo info in ADInfoBll.Instance.GetGridColumnInfos(gridName)) { if (info.GridColumnType == GridColumnType.Normal) { if (!Authority.AuthorizeByRule(info.ColumnVisible)) { continue; } if (this.Grid1.Levels.Count <= level) { this.Grid1.Levels.Add(new ComponentArt.Web.UI.GridLevel()); } ComponentArt.Web.UI.GridColumn column = GetColumn(info); if (!this.Grid1.Levels[level].Columns.Contains(column)) { this.Grid1.Levels[level].Columns.Add(GetColumn(info)); } } } //m_levelTabInfos[level] = tabInfo; //if (tabInfo.Childs.Count > 1) //{ // //throw new NotSupportedException("only one child is supported!"); //} //for (int i = 0; i < Math.Min(1, tabInfo.Childs.Count); i++) //{ // WindowTabInfo subTabInfo = tabInfo.Childs[i]; // CreateColumns(level + 1, subTabInfo); // if (!m_isHierarchicalEventCreated) // { // this.Grid1.NeedChildDataSource += new ComponentArt.Web.UI.Grid.NeedChildDataSourceEventHandler(Grid1_NeedChildDataSource); // m_isHierarchicalEventCreated = true; // } //} for (int i = 0; i < tabInfo.ChildTabs.Count; i++) { this.Grid1.Levels[level].Columns[i].DataCellCssClass = "DetailTemplate"; } }
private ComponentArt.Web.UI.GridColumn GetColumn(GridColumnInfo info) { ComponentArt.Web.UI.GridColumn column = new ComponentArt.Web.UI.GridColumn { DataField = info.GridColumnName, HeadingText = (string.IsNullOrEmpty(info.Caption) ? info.PropertyName : info.Caption) }; Type type = info.CreateType(); if (type.IsEnum || (info.CellViewerManager == "Combo" || info.CellViewerManager == "MultiCombo")) column.DataType = typeof(string); else { column.DataType = type; } string fs = Feng.Utils.DataProcess.GetFormatString(info); if (!string.IsNullOrEmpty(fs)) { column.FormatString = fs; } return column; }