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
835
Is there an event that is fired when a user clicks on a header for it to be sorted
posted

Currently I have a grid with columns that allowed for single column sorting (HeaderClickAction.SortSingle). I want to listen for an event for whenever this column is sorted so that I can place a custom sort icon on the header...however I'm not seeing any obvious SortColumnChanged sortof event names under the UltraGrid. Are there any events for this purpose? All I've seen for a solution is the recommendation to listen for BeforeSortChange and AfterSortChange (and then compare the two results to see what the clicked column is).

Parents
  • 71886
    Suggested Answer
    Offline posted

    Hello,

    I believe that since you have the 'HeaderClickAction' set to 'SortSingle' you could always hook to the 'AfterSortChange' event and check for the first index in the 'SortedColumns' collection of the 'Band':

            private void ultraGrid1_AfterSortChange(object sender, Infragistics.Win.UltraWinGrid.BandEventArgs e)

            {

                e.Band.SortedColumns[0];

            }

     

    Please feel free to let me know if I misunderstood you or if you have any other questions.

Reply Children