Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Tuned Listener
Posts: 15
Registered: ‎08-01-2008

Sorting Datagrids in SalesLogix Web 7.5.2

I've used the following code to sort a datagrid (set a default sort) on the Load Actions of a form by adding a Code Snippet Action Item


namespace Sage.BusinessRules.CodeSnippets
    public static partial class AccountJobsEventHandlers
        public static void SortDataGrid( IAccountJobs form,  EventArgs args)
            System.Web.UI.WebControls.GridView grid = (System.Web.UI.WebControls.GridView)form.grdVACCOUNTJOBSS.NativeControl; 
            grid.Sort("JOBSTATUS", System.Web.UI.WebControls.SortDirection.Ascending);


It works well when you only need one default sort.  Is there a way to add multiple sorting to a datagrid?  I want to sort by JOBSTATUS asc, JOBTYPE desc, and DATE asc.  I thought I could just add call to grid.Sort for all three, but it doesn't seem to work that way (it just sorts by the last grid.Sort call).  Has anyone figured out a way to do this?