Finding Data Column corresponding to GroupElement

2 posts, 0 answers
  1. Brian
    Brian avatar
    24 posts
    Member since:
    Apr 2008

    Posted 29 Nov 2015 Link to this post

    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 

     

       

     

     

  2. Hristo
    Admin
    Hristo avatar
    714 posts

    Posted 01 Dec 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top