Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1410
Changing "items" label in GroupByRecord to custom text
posted

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).