Hello,
I did use the code from the data virtualization context demo and adapted it (cut&paste) into my project.
It's working when using normal columns:
<
telerik:GridViewDataColumn
Header
=
"Montant Total"
DataMemberBinding
=
"{Binding Path=TotalCalculated}"
UniqueName
=
"TotalCalculated"
DataFormatString
=
"{}{0:c}"
>
</
telerik:GridViewDataColumn
>
But as soon as I add aggregate functions I get NullReferenceException... Very hard to find errors...
<
telerik:GridViewDataColumn
Header
=
"Montant Total"
DataMemberBinding
=
"{Binding Path=TotalCalculated}"
UniqueName
=
"TotalCalculated"
DataFormatString
=
"{}{0:c}"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
Caption
=
"Total : "
ResultFormatString
=
"{}{0:C}"
SourceField
=
"TotalCalculated"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
Any idea?
Thanks,
John.
17 Answers, 1 is accepted
We've fixed this immediately and the fix will be part of our next internal build (Monday) - I've added 2000 Telerik points to your account.
Kind regards,Vlad
the Telerik team
So is this supposed to work now as I just tried it out and I get a NullReferenceException. I'm using the latest version Q2 2011 (2011.2 712).
I haven't tried this functionality before so I cannot say if it has worked here in between or not.
if it's still working for you can you please attach a simple example.
Thank you
Tomas
Please, find my sample project in the attached file. It uses the latest official binaries (Q2 2011) and I was not able to reproduce the mentioned exception.
Regards,
Yordanka
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Hi Yordanka,
I found the cause of the expcetion and that is filtering.
If you in codebehind add this line:
view.FilterDescriptors.Add(
new
FilterDescriptor(
"Quantity"
, FilterOperator.IsGreaterThanOrEqualTo, 3));
Or in Xaml add this:
<
telerik:RadGridView.FilterDescriptors
>
<
telerik:FilterDescriptor
Member
=
"Quantity"
Operator
=
"IsGreaterThanOrEqualTo"
Value
=
"3"
/>
</
telerik:RadGridView.FilterDescriptors
>
Also if you do not specify either of the above and try to filter the grid at runtime the aggregate disappears but once you clear the filter it's displayed again.
Tomas
Thank you for the report.
We will investigate the problem and will contact you as soon as we have more information.
Best wishes,
Yordanka
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Any news on this issue?
Setting MemberType property for the FilterDescriptor will solve the problem:
view.FilterDescriptors.Add(
new
FilterDescriptor() {
Member=
"Quantity"
,
Operator =FilterOperator.IsGreaterThanOrEqualTo,
Value = 3,
MemberType =
typeof
(
int
)
});
All the best,
Yordanka
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
This solves the nullref, but how do you specify the MemberType in XAML?
Also the aggregate in the footer still disappears once you filter.
Tomas
To assign MemberType in xaml you need to create a class where the type is exposed as a property and then bind it to the MemberType. This demo shows how you can set type in xaml.
As for the problem with aggregates - we identified an issue and it has been logged as a bug.
Best wishes,
Yordanka
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks for your help.
Regards.
Have you set MemberType?
Best wishes,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
In my case, we have this null reference exception when using the sum aggregate function.
Should i create a filter descriptor?
Thanks
Can you post the grid version?
Kind regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
It Know works.
Thanks for your help.
The issue with aggregates disappearing from the footer once you filter is still present in 2011 Q3 release.
Do you have any public tracking of this bug?
Tomas
We resolved the issue and the fix for it will be part of the next internal build (next Monday).
Kind regards,
Yordanka
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>