Filter/Hide Group Header if Detail Section has no visible rows

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    1 posts
    Member since:
    May 2014

    Posted 27 Jul Link to this post

    My ObjectDataSource data is flattened as follows (simplified)

    Year 1, Item 1, Attribute String {empty}
    Year 2, Item 1, Attribute String {empty}
    Year 3, Item 1, Attribute String {Some data I want to express as a detail record}

    Year 1, Item 2, Attribute String {Some data to display for this detail record}
    Year 2, Item 2, Attribute String {empty}
    Year 3, Item 2, Attribute String {Some more data to display for this detail record}

    Year 1, Item 3, Attribute String {empty}
    Year 2, Item 3, Attribute String {empty}
    Year 3, Item 3, Attribute String {empty}

    I am grouping the data by item name (Item 1, Item 2, Item 3 in this example) and am displaying the item name in the group header. I would like to suppress group headers for items that do not contain any rows with an attribute string (similar to Item 3 in this example.)

    I am able to suppress detail rows with empty attribute strings using conditional formatting Field.[Attribute String] = {blank}, Visibility = false.

    However, I have not discovered how to suppress the group header.  Filtering the group header on Field.[Attribute String] <> {blank}, seems to only test the first detail row (returning only Item 2 in this example.)

    Can anyone think of a way to suppress the group header for only Item 3 for the example data above?

    Thanks in advance for any assistance you can offer.

  2. Stef
    Stef avatar
    2923 posts

    Posted 29 Jul Link to this post

    Hello Jeff,

    We can suggest you the following approaches:
    1. Use conditional formatting for the group's Header and Footer sections, where the Filter must be based on an aggregate function as the group's data scope may contain more than one data record.
    2. Use filter in the group's Filters collection based again on an aggregate function. The filter will determine whether the whole group should be visible or not. Filters can be added by selecting the report and checking its groups' properties in the Group Explorer.

    Both approaches are illustrated in the attached video. It is a SWF file that can be previewed in IE browser.

    Telerik by Progress
    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. DevCraft banner
Back to Top