Hello
When I use grouping functionality of XamDataGrid (v 11.1.20111.2193), all GroupByRecords have following label:
x items
where x is the number of child records.
I wanted to change that "items" to my custom text (for instance: "elements," "datasets" and so on).
I was able to do this by InitializeRecord event:
var gbr = record as GroupByRecord; if (gbr != null) { var count = gbr.ChildRecords.Count; gbr.Description = string.Format("{0} ({1} {2})", gbr.Value, count, "elements"); }
It works as expected, the "items" are now "elements". However:
- if I filter records, the group counteris not refreshing (obviously, because I've not added event handler.
(by default, it's refreshed when filter is changed).
Soo, I did:
RecordFilterChanged+= ... (and recalculate)
And now, I have no idea how to recalculate based on filtering (Record class doesnt have "IsFilteredOut" property right?)
I was trying to play around with RecordsManager.GetFilteredInRecords() but this also didn't work fully as expected, and I thought It's too much. Also tried with Visibility of each record, but this is also dead end.
Even If I manage to handle filters, I'm not sure if those events are all I need to handle.
Can you give me some feedback how to simply change "items" to custom text in GroupByRecord (if possible - without need to recalculating all the grouping functionality).
HI,
What do you mean when you Count CalculationType?
Can you give me an example?
Sincerely, MattDeveloper Support Engineer
Hi Matt
Thanks for the sample. This is in fact exactly what I needed.
Small issue is that, when I have custom "items" text, in makes no sense in nested grouping. Just a suggestion: Would be nice to have (in future versions) an option in grid that says "groupby items count calculaton type".
One value would be Default (as it is now)
Second option would be .. count all the leaf elements in all subnodes.
Then it makes more sense to change that "x items" to "x something".
But, again - this is just a suggestion. Thanks for sample once again!
I am just following up on this post.
Please let me know if you need further assistance.
Sincerely. Matt Developer Support Engineer
I had to retemplate the GroupByRecordPresenter and added a converter to change the format.
Please review my sample.
Sincerely, Matt Developer Support Engineer