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
1336
Is it possible to force a grouping?
posted

Hi,

I'm aware you can set a grouping level programtically, by adding a FieldSortDescription.  I'm also aware you can use FieldSettings to control the "AllowGroupBy" property.

  1. I want to force our grid to be grouped by "Name" - so I've added a FieldSortDescription in code for this field. 
  2. There are lots of columns and it wouldn't make sense to group by most of them, so I've set the main FieldSettings.AllowGroupBy to False.
  3. We do however want the end user to be able to optionally apply further grouping levels, but only for fields "Type", "Category 1" and "Category 2"  (by way of example).  So, I've set the AllowGroupBy to true, on the FieldSettings for just these three fields.

This *nearly* works well!  I run the project, expand the group by area and see the grid has correctly been grouped by "Name".  The three fields for which I've allowed gropuing, appear below.

However, the grid allows me to drag the "Name" grouping (which I was trying to force as 'always on'), to the bottom section... when I do so, the grid un-groups and the "Name" button in the group by area disappears!

Is this incorrect behaviour? Or is there any way to control it that I've missed?

Regards,

Dave

Parents Reply Children