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
115
igGrid Multi-Column Sorting Isn't Working for Me
posted

I'm new to the Infragistics products as well as the MVC application I'm working on. There is an igGrid that I'd like to enable for multi-column (MC) sorting. I've looked at a fair amount of the online documentation, and I see that MC sorting capability exists, but I haven't found any sample code that illustrates how to enable it. Below is the code I'm using to do the setup.

When I run the application, the grid shows indicators that the 2 specified columns are sorted; however, when I add a new row to the grid, the row set is not sorted. Is there something I need to do/enable so that the grid remains sorted?

Excerpt from relevant .cshtml file:

...

    .Features(
        features =>
        {
            // Start of added code ?20120720-n
           features.Sorting()
               .Mode(SortingMode.Multiple)  // Sort on multiple cols
               .ColumnSettings(settings =>
               {
                   // SORT: 1st on CrewNumber, 2nd on Event
                  settings.ColumnSetting().ColumnKey("CrewNumber").AllowSorting(true).CurrentSortDirection("ascending"); // "asc" or "ascending"; "desc" or "descending"
                  settings.ColumnSetting().ColumnKey("Event").AllowSorting(true).CurrentSortDirection("ascending");
               });
           // End   of added code ?20120720-n
            features
               .Resizing().ColumnSettings(settings =>
               {
                  settings.ColumnSetting().ColumnKey("IpSn").AllowResizing(false); 
                  settings.ColumnSetting().ColumnKey("IpTx").AllowResizing(false);

               });
           features.Updating()
               .EnableAddRow(false)
               .EnableDeleteRow(!isReadOnly && !disableChangingPreloadedEvents)

...