/// <summary> /// 获取列数据 /// </summary> /// <param name="pColumn">需要进行过滤的列</param> /// <returns></returns> public object[] GetDataes(FilteringColumn pColumn) { List <object> dataes = new List <object>(); // if (this.Dataes != null && this.Dataes.Rows.Count > 0 && pColumn != null && pColumn.GridColumn != null && (!string.IsNullOrEmpty(pColumn.GridColumn.DataIndex)) ) { var colID = pColumn.GridColumn.DataIndex; if (this.Dataes.Columns.Contains(colID)) { foreach (DataRow dr in this.Dataes.Rows) { if (dr[colID] == DBNull.Value) { dataes.Add(null); } else { dataes.Add(dr[colID]); } } } } // return(dataes.ToArray()); }
/// <summary> /// 是否显示该列 /// </summary> /// <param name="pColumn">进行筛选的列</param> /// <param name="pDataRetriever">列数据获取器</param> /// <returns></returns> public bool IsShowColumn(FilteringColumn pColumn, ColumnDataRetriever pDataRetriever) { if (this.ShowColumnStrategy != null) { return(this.ShowColumnStrategy(pColumn, pDataRetriever)); } //默认为显示 return(true); }
/// <summary> /// 获取摘要值 /// </summary> /// <param name="pColumn">需要进行过滤的列</param> /// <param name="pSummary">摘要</param> /// <returns></returns> public string GetSummary(FilteringColumn pColumn, ISummary pSummary) { if (pColumn != null && pColumn.GridColumn != null && pSummary != null && this.ColumnSummaryValues != null) { if (this.ColumnSummaryValues.ContainsKey(pColumn.GridColumn)) { var vals = this.ColumnSummaryValues[pColumn.GridColumn]; if (vals != null && vals.Count > 0) { foreach (var val in vals) { if (val.Key == pSummary) { return(val.Value); } } } } } return(null); }