Crosstab: Event fired when visibility changes

3 posts, 1 answers
  1. Christoph
    Christoph avatar
    2 posts
    Member since:
    Feb 2016

    Posted 16 Feb Link to this post

    Hi!

     I am currently trying to design a crosstab report with the following basic layout:

     

    Row 1:   |Header1 | Header 2 | Header 3| Header 4|

    Row 2:   |Group 1 |                 |                |                |

    Row 3:   |              |Group2     |                |                |

    Row 4:   |              |                 |Group 3   |                |

    Row 5:   |              |                 |                |Group 4   |

     

    The first group is visible, the rest is collapsed at the beginning.

    To make the whole table visually a bit more attractive I want to use empty lines to create blocks that make the table look like in the first attached image file.

    I achieved this by adding empty rows between Row 1 & 2, and Row 2 & 3. This however only works of course if no other group is expanded. If I e.g. expand Group 2, the result would look like in the second attached file.

    To preserve this visual blocks my idea was to insert such an empty row after each group, and change it's visibility depending on the visibility/expension-state of the group above.

     I managed this by giving the empty rows a StyleName, and in the DataBound-event of the according textbox that represents displayed groupdata I iterate through all textboxes with that Stylename and change their visibility accordingly.

     There is however one simple problem: all event that I found will only fire when I expand a group (ItemDataBound, ItemDataBinding). When I collapse a group no event seems to be fired at all.

    Are there any events that could help me in this case? Or would there be a databinding alternative?

     

  2. Answer
    Stef
    Admin
    Stef avatar
    3047 posts

    Posted 18 Feb Link to this post

    Hi Christoph,

    Please check the attached video (SWF file) in IE browser. It illustrates how we created the attached demo report - TRDX file that can be previewed in the Standalone Designer tool of Telerik Reporting Q1 2016.

    The steps in the video:
    1. Blank report with a CsvDataSource. The used data structure is just for the example;
    2. Styling the visible rows to be colored differently;
    3. Adding a blank row below the header row by using the Context Menu;
    4. Adding an Action to the outermost row group in the Table item. The action toggles the visibility of the inner row group.
    5. Adding another parent row group with the same grouping as the current outermost row group through the Group Explorer.
    6. Adding a row inside the group defined by the row group added at step 5.
    7. Styling the visible rows to looks as if they are blank or hiding them.

    For more details, please check Table: Basic Concepts and Table: Understanding table Cells, Rows and Columns.


    Let us know if you have any further questions.

    Regards,
    Stef
    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. DevCraft banner
  4. Christoph
    Christoph avatar
    2 posts
    Member since:
    Feb 2016

    Posted 22 Feb in reply to Stef Link to this post

    Hello Stef!

    Thank you very much, that's actually a simple solution - I didn't think about the possibility to assign more than one action to an item!

    Now every item I expand/collapse will just trigger die Visibility of the empty row above, the group and the empty row below it, and it looks like I want it to look :)

     

    Thank you very much!

Back to Top