Esempio n. 1
0
        public void InstantiateIn(Control container)
        {
            PivotGridFieldValueTemplateContainer c    = (PivotGridFieldValueTemplateContainer)container;
            PivotGridFieldValueHtmlCell          cell = c.CreateFieldValue();
            PivotFieldValueItem      valueItem        = c.ValueItem;
            PivotDrillDownDataSource ds = valueItem.CreateDrillDownDataSource();
            int id = Convert.ToInt32(ds[0]["ProductID"]);

            cell.Controls.AddAt(cell.Controls.IndexOf(cell.TextControl), new MyLink(c.Text, id));
            cell.Controls.Remove(cell.TextControl);
            c.Controls.Add(cell);
        }
Esempio n. 2
0
 private bool HaveSingleChild(PivotGridData data, PivotFieldValueItem valueItem)
 {
     if (valueItem.MinLastLevelIndex == valueItem.MaxLastLevelIndex)
     {
         return(true);
     }
     else
     {
         var nestedField = data.GetFieldByArea(valueItem.Area, valueItem.Field.AreaIndex + 1);
         IEnumerable <DevExpress.XtraPivotGrid.PivotDrillDownDataRow> rows = valueItem.CreateDrillDownDataSource().Cast <DevExpress.XtraPivotGrid.PivotDrillDownDataRow>();
         return(rows.Select(row => row[nestedField]).Distinct().Count() == 1);
     }
 }