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

Excel Export & Remove Expand Icon

3 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Oct 2013, 07:29 PM
Hi All,

I have an all code-behind solution and noticed an interesting quirk.  I have a grid with hierarchy.  Whenever I go to export it to Excel I receive a blank row under each row with content.  I found the following link that points out my HiearchyLoadMode as being the culprit, and sure enough, if I switch from Client to ServerOnDemand the blank rows go away. 

Unfortunately, I am using the Export to Excel functionality along with this link that pertains to hiding the expand/collapse icons when there are no records, and setting it to something other than Client hides all expand/collapse icons.

Does anyone one have any ideas how I can have both?

Thanks,
Mark

3 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 16 Oct 2013, 10:38 AM
Hi Mark,

I used the code from the provided help article but I was not able to reproduce the issue. Could you please give it a try and let me know how it differs from your real setup. I am looking forward to your reply

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Mark
Top achievements
Rank 1
answered on 16 Oct 2013, 02:48 PM
Kostadin,

Thank you for the reply!

My solution is completely in code-behind in a SharePoint project.  My RemoveExpandIconWhenNoRecords is identical to yours and a I set
radgrid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;

Anything other than GridChildLoadMode.Client completely hides all of the Expand Icons, but GridChildLoadMode.Client creates blank rows when I export to Excel.

Thanks,
Mark

0
Mark
Top achievements
Rank 1
answered on 16 Oct 2013, 03:10 PM
Actually setting

RadGrid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;

before exporting to Excel appears to have cured the problem.

Thanks,
Mark

Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Mark
Top achievements
Rank 1
Share this question
or