This is a migrated thread and some comments may be shown as answers.

Finding Data Column corresponding to GroupElement

1 Answer 38 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 29 Nov 2015, 02:02 PM

Hi,

Using the GroupElementFormatting event, I would like to format the values based on knowledge of the original data column. 

So  how does one get the PropertyGroupDescription when knowing the PivotGroupElement?

/Brian 

 

   

 

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 01 Dec 2015, 02:03 PM
Hi Brian,

Thank you for writing.

The arguments provided by the GroupElementFormatting event provide access to the data object of the current PivotGroupElement. Knowing that object and depending on your business logic you can modify the visual appearance of the group element: Formatting Appearance. Please also check my snippet below: 
private void radPivotGrid1_GroupElementFormatting(object sender, PivotGroupElementEventArgs e)
{
    string name = e.GroupElement.Data.Name;
    if (name == "Copy holder" || name == "Mouse pad")
    {
        e.GroupElement.BackColor = Color.LightGreen;
    }
    else
    {
        e.GroupElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
    }
}

I am also sending you a screenshot showing the result on my end.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PivotGrid and PivotFieldList
Asked by
Brian
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or