I don't want to export Hierarchical Grid Rows that have no child records.

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

    Posted 01 Mar 2016 Link to this post


    I am using version 2015.1.401.40 of the ASP.NET controls for AJAX.

    I would think my question would be very common and easy to do.

    I have a RadGrid with a MasterTableView and 1 DetailTable (GridTableView). I am using NeedDataSource for binding and it is all working fine.

    Not all records in the master, have child records. For the rows that do not, I have hidden the expand/collapse button in the DetailTableDataBind event.

    When I export to Excel, I want to expand all rows that contain a child record, so that those rows get exported.  I was doing that in DetailTableDataBind by setting every GridDataItem .Expanded = True.


    The problem with this is that it expands and exports the child rows that say "No Child Records".

    Question: How can I NOT have it export the gridtableview, if there are no child records?


    In the DetailTableDataBind, if there are no child records I set the DetailTableView.Visible = False, but my export still contains a blank row (which is better than the "No Child Records", but not perfect).




  2. Eyup
    Eyup avatar
    3320 posts

    Posted 04 Mar 2016 Link to this post

    Hello Brent,

    You can try to hide the DetailTableView.NamingContainer as well which is a control of type GridNestedViewItem. Please use the approach demonstrated in the following article:

    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