get fileld name is summary Gridview Devexpress

0 thích 0 không thích
39 lượt xem
đã hỏi 17 Tháng 7, 2018 bởi nguyenthao (9,040 điểm)
public Dictionary<string, SummaryItemType> GetAllColumnSummaryInGridView(GridView gridview)
        {
            Dictionary<string, SummaryItemType> result = new Dictionary<string, SummaryItemType>();
            foreach (GridColumn column in gridview.VisibleColumns)
            {
                if (column.FieldName != "DX$CheckboxSelectorColumn")
                {
                    if (gridview.Columns[column.FieldName].Summary != null)
                    {
                        if (gridview.Columns[column.FieldName].Summary.Count > 0)
                        {
                            var data = gridView1.Columns[column.FieldName].Summary.AsEnumerable();
                            var field_name = (from t in data
                                              select t.FieldName).FirstOrDefault();
                            var summary_type = (from t in data
                                                select t.SummaryType).FirstOrDefault();
                            result.Add(field_name, summary_type);
                        }
                    }
                }

            }
            return result;
        }
Looking for an answer?  Share this question:     

Xin vui lòng đăng nhập hoặc đăng ký để trả lời câu hỏi này.

...