This is a migrated thread and some comments may be shown as answers.

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

1 Answer 246 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brent Hetland
Top achievements
Rank 1
Brent Hetland asked on 01 Mar 2016, 01:57 PM

Hi,

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.

ISSUE:

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).

 

Thanks,
Brent

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 04 Mar 2016, 07:24 AM
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:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/hierarchical-grid-types-and-load-modes/how-to/hiding-the-expand-collapse-images-when-no-records

Regards,
Eyup
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
Tags
Grid
Asked by
Brent Hetland
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or