6 Answers, 1 is accepted
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 28 Sep 2009, 01:18 PM
I think you forgot the SourceField, which tells your CountFunction what to count exactly.
Here is a code snippet I use to put an aggregate function on a footer :
Here is a code snippet I use to put an aggregate function on a footer :
SumFunction countFunction = new SumFunction(); |
countFunction.ResultFormatString = "{0:F}"; |
countFunction.SourceField = r.lib_zone; |
countFunction.Caption = "Total : "; |
col.AggregateFunctions.Add(countFunction); |
FormGrille.ShowColumnFooters = true; |
col.Footer = FormGrille.AggregateResults["countFunction"] ; |
0
johanr
Top achievements
Rank 1
answered on 28 Sep 2009, 02:01 PM
I tried adding the source field but it made no difference.
Edit:
Something i did notice.
If I sort the grouped column afterwards, the results of the function is shown.
This might be a refresh problem perhaps.
Should this happen inside or ourside of a DeferRefresh?
Edit:
Something i did notice.
If I sort the grouped column afterwards, the results of the function is shown.
This might be a refresh problem perhaps.
Should this happen inside or ourside of a DeferRefresh?
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 28 Sep 2009, 02:15 PM
Quick question before answering, does you scenario require the aggregate function to be done in code instead of doing it in xaml ?
0
johanr
Top achievements
Rank 1
answered on 29 Sep 2009, 06:58 AM
Yes, it becomes part of a save and load process of profiles for our application.
This means that I need to be able to creaet the functions in code as profiles are changed.
Everything else works great, it's just this one last part that is being a bit of a problem.
I have descovered that it does indeed add the function but after adding it the UI is not flushed.
If you perform a action like sorting on a column then all of a sudden the function results are visible.
So it works but not 100%.
This happens outside of a defer refresh because defer refresh does not allow you to create group definitions.
I had a similar UI flush problem with saving column sort information where the column header did not highlight after setting it.
When I put that in a defer refresh, that ui flush came right that is why I am thinking that this might be something similar, but I don't know how to tell the grid to redraw itself
What would be perfect is if you could have something like.
grid.BeginUpdate();
do some stuff like creation of stuff
grid.EndUpdate(); <- this does the refresh work for you.
This means that I need to be able to creaet the functions in code as profiles are changed.
Everything else works great, it's just this one last part that is being a bit of a problem.
I have descovered that it does indeed add the function but after adding it the UI is not flushed.
If you perform a action like sorting on a column then all of a sudden the function results are visible.
So it works but not 100%.
This happens outside of a defer refresh because defer refresh does not allow you to create group definitions.
I had a similar UI flush problem with saving column sort information where the column header did not highlight after setting it.
When I put that in a defer refresh, that ui flush came right that is why I am thinking that this might be something similar, but I don't know how to tell the grid to redraw itself
What would be perfect is if you could have something like.
grid.BeginUpdate();
do some stuff like creation of stuff
grid.EndUpdate(); <- this does the refresh work for you.
0
Hi johanr,
You could try calling RadGridView.Rebind to refresh the UI.
All the best,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You could try calling RadGridView.Rebind to refresh the UI.
All the best,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Johan Rabie
Top achievements
Rank 1
answered on 30 Sep 2009, 06:47 AM
That certainly did the job.
Thank you very much, I am very chuffed with the results.
Thank you very much, I am very chuffed with the results.