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
790
Stupid question
posted

I know this is a newbie question...but I can't find the answer...maybe having a bad brain day.

I have several grids in my application that are sorting based on a hidden column that is specifically built to implement some really wacky sorting rules we have.  It is working great...except for one grid.

That grid has column groups set up to give a common header for each group (not a group by...just column groups).  If I apply my sort like I do in the other grids (either by setting SortIndicator or by adjusting the sorted columns collection) it is having no effect.  If I then click on a header, the sorting by that header appears to happen normally...and it appears that it is setting the SortedColumns in the way I would expect on a grid without column groups.

Can anybody help me figure out how to sort on a single column when column groups are in use?

I can't afford to pull out any more hair :-)

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    What do you mean by "column groups". From the term, it sounds like you mean you have Groups defined on your band and each column is assigned a Group. But there's no way Groups could ever have any effect on sorting. So I think you probably mean that you are using OutlookGroupBy.

    If that's the case, then the way OutlookGroupBy works is that the grid is first sorted by the column that is being grouped. This is necessary so that all of the rows with matching values are adjacent. Then the grid loops through the rows and puts them together into groups.

    So most likely what's happening is that when you group the grid, you are sorting on a column and your hidden column is no longer sorted.

    So, I'm not sure how you could make this work the way you have it set up. If you allow the user to sort on multiple columns, then you will have to handle the BeforeSortChange or AfterSortChange event and make sure that you always add in your hidden column at the end if it's not already there. This could be very tricky and I'm not sure it's possible.

Children