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
235
Grouping on demand
posted

Hi!

I have a feature request, where I have to activate grouping only if the group-operation will result in more than one group. If there will be only one group, I have to display a “flat” list. Is there an easy way how I can achieve such a behaviour?

To provide a little bit more background information.

  1. The bound data source is populated asynchronously
  2. During initialization of the view, one or more record filters may be applied in code-behind.
  3. The group-by-filter is defined in code-behind or at design time
  4. We use NetAdvantage for WPF 2012 Vol.1

Best regards,
HiCo

Parents
No Data
Reply
  • 16495
    Offline posted

    Hello Hico,

     

    Thank you for your post.

     

    I have been looking into it. I am not sure that I understand your requirements correctly. If you want to check the number of groups in XamDataGrid, you can handle it`s Loaded event. In the event handler of Loaded you can  get the count of current groups by using Count property and access it by RecordManager.Groups collection of XamDataGrid. In order to be able to clear the groups, if their  count is equal to  one, you can use Clean method of SortedFields collection. I created a short sample application based on your scenario to show you how you can implement the functionality that you are looking for.  If the attached sample application does not meet your goals, would you please modify it with the functionality, that you are using. This way I would be able to further investigate your requirements for you and provide you with more detailed information on this matter. Please let me know if I am missing something about your scenario.

     

     

    Please let me know if you need any further assistance.

    GroupingOnDemand.zip
Children