Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 28, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Sort a datagrid / gridview by more than one field / column (in 7.5.2)
Alec Denholm
Posts: 34
 
Sort a datagrid / gridview by more than one field / column (in 7.5.2)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 10 7:03 AM
Hey guys,

I'm trying to sort a data grid (Account:Contacts) by more than one field, let's say Status then LastName.

I've tried the following in a Code Snippet Action Item (Note: using System.Web.UI.WebControls) :

GridView grid = (GridView)form.grdAccountContacts.NativeControl;
string sortExpression = "Status,LastName";
SortDirection sortDirection = SortDirection.Ascending;
grid.Sort(sortExpression, sortDirection);

This results in an error, "could not resolve property: Status,LastName of: Sage.SalesLogix.Entities.Contact". Fair enough. But how are we supposed to sort by more than one column if this is not a valid sort expression? Because it is a valid sort expression for a gridview, so says MSDN.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sort.aspx
Am I missing something here?

Thanks,
Alec D
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Sort a datagrid / gridview by more than one field / column (in 7.5.2)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 10 11:30 AM
I must admit I have never tried using two - but underneath the gridview is the entity model, which will try to tie any values you pass to it to a valid property. It is not clever enough to delimit comma separated properties. The samples on the page you provide use a sqldatasource so behaves differently. We are working with an objectdatasource in SLX remember.

Having not faced this problem myself I am struggling to suggest anything....maybe try would googling "sorting with multiple columns on an objectdatasource"....

Thanks,
Nick



[Reply][Quote]
Alec Denholm
Posts: 34
 
Re: Sort a datagrid / gridview by more than one field / column (in 7.5.2)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 10 7:51 AM
Thanks for your reply, Nick.
Unfortunately when following your recommendation, I'm only finding more suggestions that my sort expression is valid for ObjectDataSource.
I'll keep looking...
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Sort a datagrid / gridview by more than one field / column (in 7.5.2)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Jan 12 9:54 AM
fiogf49gjkf0d

Almost a year later......is there a solution?

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/28/2025 8:00:15 AM