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
90
Multi Sorted columns programmatically Ultragrid
posted

Hi

I have gone through several posts on this topic, but for some reason, must be missing some piece.

We have an ultragrid with many columns.

I want to programmatically set the sorting of multiple columns based on a boolean flag (yes sorts to one set of four columns; no sets to a different set.)

Is there an end to end example? I have provided the pieces I tried to put together myself.

 

Do I need

1. something in the ugrd_AfterSortChange or ugrd_BeforeSortChange routines?

2. ugrd_InitializeLayout routine, such as:

         e.Layout.Override.HeaderClickAction = HeaderClickAction.SortMulti

3. I have the following rows set as my multi for one condition using the following syntax

     ugrd.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti            

     ugrd.DisplayLayout.Bands(c_bandAccounts).Columns("HistoryExistsSort").SortIndicator = SortIndicator.Ascending            

     ugrd.DisplayLayout.Bands(c_bandAccounts).Columns("FollowupSort").SortIndicator = SortIndicator.Ascending            

     ugrd.DisplayLayout.Bands(c_bandAccounts).Columns("GuarantorLastName").SortIndicator = SortIndicator.Ascending            

     ugrd.DisplayLayout.Bands(c_bandAccounts).Columns("AccountNumber").SortIndicator = SortIndicator.Ascending

 

Thank you,

 - M