Hello everyone,
I have a XamGrid in that state.
And here is my problem : when i export the XamGrid with the export function from the samples everything is fine, but when i apply more than one group i have only the fisrt group expandable in the Excel file.
As we can see we can collapse/expand the first group by the second is just indent.
Is someone knows how can I do to collapse the next groups ?
I don't think there is any way to control the indentation of the group markings.
Is anyone could help me ?
Excuse me i miss something in my post.
The Excel is exactly what i want but it's for the left part where we can collapse or expand the groups.
In this section each group of elements of each group has a higher outlinelevel, for example for the group 2 the first elements have points under the third column in the left section and the second elements hav points under the fourth column.
And this is my problem, i would like the elements of gorup 2 under the same column in left section.
I don't understand your problem. In the XamGrid, you have a GroupByRow with value 1, 2 groupby rows with Value 2, and then a few child elements below that. The excel looks the same to me.
I don't understand what you are looking for. Do you expect the "Group 2" text to also be in Column "A" in excel?
Thanks for this explanation about the OutlineLevel property. I tried to apply this to the export of the XamGrid but i still have a problem with the levels.
Here an example of the grid that i'm trying to export :
And here the Excel file i get :
The groups are correctly set but the probleme is on the levels as you can see the elements of the group 2 are set to an higher level than those of the group 1. And apparently in Excel the limit of level is 7 so i've been quickly blocked with more elements.
Here the code i used :
private void IterateGroupByRow(GroupByRow groupByRow,int outlinelevel)
{
WorksheetMergedCellsRegion mergedRegion = sheet.MergedCellsRegions.Add(_currentMergedRow, _currentMergedColumn, _currentMergedRow, _currentMergedColumn + _initialColumnsCount);
mergedRegion.Value = groupByRow.GroupByData.Value == null ? "" : groupByRow.GroupByData.Value.ToString();
_currentMergedRow++;
_currentMergedColumn++;
if (groupByRow.HasChildren)
RowCollection groupByRowChildren = groupByRow.Rows;
foreach (Row child in groupByRowChildren)
_countGrouped = 0;
_countNotGrouped = 0;
if (child.RowType == RowType.GroupByRow)
int temp = this.GetQueryElementItemsCount(child as GroupByRow);
for (int i = 0; i < temp; i++)
//this is test is only here to avoid the exception raised when the outlinevel is higher than 7
if (outlinelevel < 7)
sheet.Rows[_currentMergedRow + i + 1].OutlineLevel = outlinelevel;
}
IterateGroupByRow(child as GroupByRow, outlinelevel++);
_currentMergedColumn--;
else
IterateRow(child);
Regards.