6/28/2025 10:30:08 AM
|
|
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!
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.
|
|
|
|
Sort a datagrid / gridview by more than one field / column (in 7.5.2)
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 |
|
|
|
Re: Sort a datagrid / gridview by more than one field / column (in 7.5.2)
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
|
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|