Quantcast
Channel: SalesLogix – Customer FX
Viewing all articles
Browse latest Browse all 169

Sorting a SlxGridView web control using Linq

$
0
0

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); 
...

Viewing all articles
Browse latest Browse all 169

Trending Articles