I have two different AggregateFunctions in a GridViewDataColumn, and I would like to show the results in different objects. The first one should be shown in a TextBox, and the second, in a TextBlock.
This is the closer I got so far, but, obviously, both AggregateFunctions results are shown in a TextBox:
How can I achieve this? Any help would be appreciated.
6 Answers, 1 is accepted
You can achieve this by using a regular ItemsControl instead of our AggregateResultsList, which is an ItemsCotrol too, but you can not use its ItemTemplateSelector. Basically, by using ItemsControl's ItemTempalteSelector you can choose to return a different template for its items. Please check the attached sample project for a reference and let me know how it works for you.
Hi, Yoan. Thanks for the answer, but unfortunately, it didn't help. I'm pasting my grid and attaching an image with the result.
Notice that my custom footer is in the second RadGridView element. It's important to mention that I have created my AggregateTemplateSelectorStyle class, and I think there is no problem with that, since, while debugging, the breakpoint in it is hit.
As you can see in the attached image, the result concatenates the AggregateFunctions' captions to the actual value, and no textbox is being rendered.
I appreciate if you could help.
I am afraid that with the supplied information I cannot figure out what is going on. May I ask you to open a new support ticket where you can attach a sample project. I will debug it on my side and I will assist you further.
Unfortunately I can't paste it. Anyway, when I tested it in a new project, it worked. But when I do the same thing in my actual project, the TextBox doesn't show.
Could this particular template selector be overridden by some other style that I have?
It could be overridden if you are setting the ItemTemplate of the ItemsControl. Please check in your application for this code.
that was my mistake. I was using a footer, when, actually, what I needed was a GroupFooter. So, by using the code below, it worked:
Thanks a lot for your help, I really appreciate it!