Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
Display summary row only when count of row is greather than 0
posted

Is there any way, how can I display / hide summary row, when count of rows in grid will be changed?

What I need to do is to hide the summary's row in case of rows count in grid is 0.

 

Thanks.

  • 469350
    Verified Answer
    Offline posted

    You can show and hide summaries using the SummaryDisplayArea property on the SummarySettings. To hide a summary, you would simply set the SummaryDisplayArea to None.

    The tricky part of this is detecting when there are 0 rows in the grid. There's no single event for this. And, in fact, you really can't rely completely on an event of the grid, because no grid event will fire when you add a row to the data source, for example.

    So you would have to trap all the places in your code where you know rows could be added or removed from the grid's data source and then check the rows count at that point and set the SummaryDisplayArea on each summary accordingly.