/// <summary>
        /// GetTextCore
        /// </summary>
        /// <param name="value"></param>
        /// <param name="formatInfo"></param>
        /// <param name="gridElement"></param>
        /// <returns></returns>
        protected override string GetTextCore(object value, CellTextFormatInfo formatInfo, GridElement gridElement)
        {
            DataCell cell = gridElement as DataCell;

            if (cell == null)
            {
                return(null);
            }
            if (cell.Value == null)
            {
                Xceed.Grid.DataRow row = cell.ParentRow as Xceed.Grid.DataRow;
                if (row == null)
                {
                    return(null);
                }
                if (row.DetailGrids.Count == 0)
                {
                    return(null);
                }
                MyDetailGrid detailGrid = row.DetailGrids[0] as MyDetailGrid;
                if (detailGrid == null)
                {
                    return(null);
                }

                string functionName, fieldName, format, where;
                int    level = -1;

                MySummaryRow.ExtractParameters(m_statisticsFormat, out functionName, out fieldName, out format, ref level, out where);
                cell.Value = Feng.Utils.ConvertHelper.ChangeType(MySummaryRow.GetVariableFunctionResult(detailGrid.GetSortedDataRows(true),
                                                                                                        functionName, fieldName, format, level, where), cell.ParentColumn.DataType);
            }
            return(base.GetTextCore(value, formatInfo, gridElement));
        }
示例#2
0
        private void AddCheckColumnToDetailGrid(MyDetailGrid detailGrid)
        {
            foreach (Xceed.Grid.Column column in detailGrid.Columns)
            {
                column.ReadOnly = true;
            }
            m_checkColumns.Add(detailGrid.AddCheckColumn());
            detailGrid.ReadOnly = false;

            foreach (MyDetailGrid subDetailGrid in detailGrid.DetailGridTemplates)
            {
                AddCheckColumnToDetailGrid(subDetailGrid);
            }
        }