public void InstantiateIn(Control container) { PivotGridFieldValueTemplateContainer c = (PivotGridFieldValueTemplateContainer)container; PivotGridFieldValueHtmlCell cell = c.CreateFieldValue(); cell.Controls.AddAt(cell.Controls.IndexOf(cell.TextControl), new HeaderLink()); cell.Controls.Remove(cell.TextControl); c.Controls.Add(cell); }
public void InstantiateIn(Control container) { PivotGridFieldValueTemplateContainer c = (PivotGridFieldValueTemplateContainer)container; PivotGridFieldValueHtmlCell cell = c.CreateFieldValue(); if (c.ValueItem.CanShowSortBySummary && !c.ValueItem.IsAnyFieldSortedByThisValue) { cell.Controls.AddAt(cell.Controls.IndexOf(cell.TextControl), GetHyperLink(c)); cell.Controls.Remove(cell.TextControl); } c.Controls.Add(cell); }
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); }
public void InstantiateIn(Control container) { PivotGridFieldValueTemplateContainer c = (PivotGridFieldValueTemplateContainer)container; PivotGridFieldValueHtmlCell cell = c.CreateFieldValue(); PivotFieldValueItem valueItem = c.ValueItem; PivotFieldValueEventArgs helperArgs = new PivotFieldValueEventArgs(valueItem); PivotGridField[] fields = helperArgs.GetHigherLevelFields(); List <object> fieldValues = new List <object>(); foreach (PivotGridField field in fields) { object currentValue = helperArgs.GetHigherLevelFieldValue(field); if (currentValue != null) { fieldValues.Add(currentValue); } } cell.Controls.AddAt(cell.Controls.IndexOf(cell.TextControl), new MyLink(c.Text, fieldValues)); cell.Controls.Remove(cell.TextControl); c.Controls.Add(cell); }