Sorting a SlxGridView web control using Linq

In a previous post, I described  how you can sort a grid in the 7.5x level of Infor CRM (formerly Saleslogix).  Apparently in 8.1x that method doesn’t work but you can also do the same using Linq.

Lets say I am on the Account page and want to sort the contact grid by CreateDate in descending order.  I can use the following code to do so:

Sage.Entity.Interfaces.IAccount acc = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount; 
var orderedList = acc.Contacts.OrderByDescending(x => x.CreateDate); 
grdContacts.DataSource = orderedList; 

To sort ascending you would just use this instead:

var orderedList = acc.Contacts.OrderBy(x => x.CreateDate); 

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!