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
325
Allow custom grouping in predetermined coding on Grid
posted

I have a grid which allows the users to select from a drop down box to see the grid in predetermined groups.  So they do not have to drag the column header up to the grouping area of the grid.

 The code for this is...

grdEmployeeInfo.DisplayLayout.Bands(0).SortedColumns.Add(grdEmployeeInfo.DisplayLayout.Bands(0).Columns(5), False, True)

 And this works great.

Now the users are wanting a custom grouping option.  There is a column that counts totals horizontally.  The users want a predetermined group that sorts by < 2 and > 1. So if they choose this grouping option, they will get one group with all records where the horizontal total is less than 2, and then a 2nd group of records where the horizontal total is 2 and greater.

 This can be built by the users using the "(Custom)" grouping option on the grid, but this might get confusing for new users.  Is there anyway to code this in the VB code?

Let me know and thank you for your time.

T.J.

  • 469350
    Offline posted

    Hi,

        Yes, what you can do is create a custom GroupByEvaluator and assign it to the column.

        What you do is create a class that implements IGroupByEvaluator. The interface allows you to determine which rows belong in the same group and which don't.