Getting access to strongly typed object that I've bound the PivotGrid to

2 posts, 0 answers
  1. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 04 Sep 2015 Link to this post


    I'm using 2015.1.401 of your controls.

    I'm binding the PivotGrid to a List (Of SupplierAlert), where SupplierAlert is my class that represents a business object we work with.

    One thing that is great about working with the regular RadGrid is that in the ItemDataBound method I can cast the dataitem into my type and then I can do all my logic using properties of my type.  So for instance I could check a SupplierAlert.AlertLevel or whatever on my object as it bind, and color the cell red if it is a High Alert.

    Can I do anything similar to that in the PivotGrid?  In CellDataBound for instance, I want to check my SupplierAlert.HasActionItems property for each detail cell (not any of the aggregates) and if it is true, then I may want to add an img to it or something (don't worry about how to add an img to the cell...  I can figure that out).

    Again, is there a method on the server that I can use when the pivotgrid binds, or even after it binds, to do this type of logic?



  2. Eyup
    Eyup avatar
    3625 posts

    Posted 08 Sep 2015 Link to this post

    Hi Brent,

    The ItemDataBound event is not available with RadPivotGrid because it is not per record control, but rather it is a summarization control in its essence. It uses information from all the records to apply calculations in its core engine and only displays the results in its grid structure. In this sense, you cannot access the items individually and manipulate their data on a singleton basis as with RadGrid.

    Therefore, it is not possible to implement item-based logic with RadPivotGrid  as you can achieve with other data visualization controls. RadGrid and RadListView for example provide ItemDataBound and ItemCreated events where you can examine the details of every record. RadPivotGrid is specifically designed for calculating large amount of numeric values and it displays only the result from these summaries.

    Maybe you are looking for a RadGrid with a Hierarchy structure integrated with custom aggregate calculations:

    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
Back to Top