I have a WebHierarchicalDataGrid with parent and child data that have the same visible column layout. On the web page I have aligned my columns in the two bands such that they appear like they're in the same column. This lets me not show column headers on the child band.
When I export the data, I love the fact that the Outline Level causes excel to group the data in a parent / child manner. However I don't want the exported child data to start in column B.
I can see all the events that can be trapped, but it seems like the column index and other useful properties are all read-only. How can I push child data over 1 column to the left on every row?
I am using v11.1 of the ASP.Net controls
Thanks!
Hi Philip,
As I can understand you was able to achieve this in the grid and the issue appears only when the grid is exported. Are you using WebExelExporter to export the grid?
And also would it be possible for you to attach a screenshot of the grid and what is the expected behavior that you need?
Looking forward to hear from you.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
If you look at the attached screenshot you can see I've expanded the first parent row. The child rows have been arranged such that they have the same layout and therefore fit under the same column headers. We really like this functionality.
When you hit the Export Grid link in the lower right corner, it exports the hierarchical grid using the WebExcelExporter. Again, this is working great as well. In order to ensure that the excel output has both parent and child rows, I am using this bit of code:
foreach (ContainerGridRecord row in whdgSLRDetails.GridView.Rows) { row.ExpandChildren(); } weeTransactions.Export(true, whdgSLRDetails);
The only problem I am having is that the child rows when output to excel are shifted one column to the right, almost as if to show them as indented relative to the parent. That would be fine if I were outputting the child headers, but since they're the same as the parent headers I just want all the data to line up as it does in the screenshot above. Here is an example of the excel output highlighting what I'd like to change.
Please let me know if you have any ideas as to how I can adjust the starting column of these child rows. Or if you need more info.
Hi Phil Peters,
This is currently not possible in the control. As you mentioned, the column offset is read-only. This would really need a feature request to be implemented properly. It could either be making those values editable on the event. Or probably, what would make more sense would be to add an event that fires before each row island is exported where the offset could be changed once. Another option would be a new property on the excel exporter to disable this indenting. So please submit a feature request for this.
As for what you can currently do. It's kind of a pain, but you might have to handle excel row exported and move the values over cell by cell when the outline level is 1. Then delete the last cell since you'll have moved it and now will need it blank. I hope this makes sense.
regards,David Young
Yes, I was thinking a property to specify the offset indent level would probably be best, although I could see how that might be tricky if you have multiple offsets and want a different indent level for each one.
If there is a workaround I can use in the row exported event, that's good enough for me. I will give that a shot and let you know if I have any problems.
Thanks for your help!