Hi,
I am having an issue with a custom defined datagrid with specific columns, aggregation and grouping and it does not work...well, not in C#.
The grouping works 100% if defined in XAML, but its hit and miss for c#, mostly miss.
Aggregation has never worked.
I am basically generating PivotItems... which works, and then I am populating each pivot with a datagrid with the specific columns defined, as well as Grouping and Aggregation rules. The population of the PivotItems, DataGrids and the Data all work perfectly except the Aggregation and Grouping.
I have even tried using a XAML template... also doesn't work, so I am at a loss.
Could someone please provide some tips as to what I am doing wrong. Any help or suggestions would be greatly appreciated.
Thanks
My Code is below:
01.
private
void
BuildPivots()
02.
{
03.
if
(App.Categories !=
null
)
04.
{
05.
foreach
(Categories Category
in
App.Categories)
06.
{
07.
Home_PivotShell.Items.Add(
new
PivotItem
08.
{
09.
Header = Category.Name,
10.
Name = Category.Id,
11.
Content =
new
RadDataGrid
12.
{
13.
AutoGenerateColumns =
false
,
14.
UserEditMode = DataGridUserEditMode.External,
15.
ItemsSource = App.DataSet.Where(x => x.CategoryId == Category.Id),
16.
GroupDescriptors =
17.
{
18.
new
PropertyGroupDescriptor() { PropertyName =
"Name"
, DisplayContent =
"Description"
}
19.
},
20.
AggregateDescriptors =
21.
{
22.
new
PropertyAggregateDescriptor() { PropertyName =
"Column1"
, Function = KnownFunction.Count}
23.
},
24.
Columns =
25.
{
26.
new
DataGridTextColumn() { PropertyName =
"Name"
, Header =
"Description"
},
27.
new
DataGridTextColumn() { PropertyName =
"Column1"
},
28.
new
DataGridTextColumn() { PropertyName =
"Column2"
},
29.
new
DataGridTextColumn() { PropertyName =
"Column3"
},
30.
new
DataGridTextColumn() { PropertyName =
"Column4"
},
31.
new
DataGridTextColumn() { PropertyName =
"Column5"
},
32.
new
DataGridTextColumn() { PropertyName =
"Column6"
},
33.
new
DataGridTextColumn() { PropertyName =
"Column7"
},
34.
}
35.
}
36.
});
37.
}
38.
}
39.
}