Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, July 6, 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: v7.5 - Automatically Sorting a data grid?
Jim Mizia
Posts: 49
 
v7.5 - Automatically Sorting a data grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 May 09 2:17 PM
Is there an easy way to automatically sort the records in a data grid? I have a grid that I want to sort by modify date, with the most recently modified record on the top of the list. I can enable sorting on the column, but I'd like it to sort automatically when the grid is displayed, or changed.

Thanks!

Jim M.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: v7.5 - Automatically Sorting a data grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 May 09 3:53 PM
Jim, you'll need to put a couple of lines of code into a LoadAction. I have a write up of how to do that here: http://customerfx.com/pages/crmdeveloper/2009/03/26/setting-the-default-sort-for-a-datagrid-in-saleslogix-web-revisited.aspx

-Ryan
[Reply][Quote]
Jim Mizia
Posts: 49
 
Re: v7.5 - Automatically Sorting a data grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 May 09 6:47 AM
Perfect! Thanks Ryan.

Jim M.
[Reply][Quote]
Jim Mizia
Posts: 49
 
Re: v7.5 - Automatically Sorting a data grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 May 09 1:55 PM
Ryan -

I'm having some trouble with the code sample (mostly due to my lack of skill in this area!)
***************
public static partial class AcProductSummaryEventHandlers
{
public static void grdCProductSummarysSort(IAcProductSummary form, EventArgs args)
{
System.Web.UI.WebControls.GridView grid = (System.Web.UI.WebControls.GridView)form.grdCProductSummarys.NativeControl;
grid.Sort("ModifyDate", SortDirection.Descending);
}
}
***************
When I attempt to build the web platform I get an error indicating that "The name 'SortDirection' does not exist in the current context".

I think that I understand all the components of the code, but I must be missing something. Thoughts?
[Reply][Quote]
Alexander Pfingstl
Posts: 43
 
Re: v7.5 - Automatically Sorting a data grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 May 09 4:08 AM
Hi,

I had the same. The SortDirection is part of
System.Web.UI.WebControls.
So just write
System.Web.UI.WebControls.SortDirection
This would solve the error.
Hope this works as my grids are not getting sorted, might have something else wrong in my form.
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: v7.5 - Automatically Sorting a data grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 May 09 8:59 AM
Quote:
Originally posted by Alexander Pfingstl

Hi,

I had the same. The SortDirection is part of
System.Web.UI.WebControls.
So just write
System.Web.UI.WebControls.SortDirection
This would solve the error.
Hope this works as my grids are not getting sorted, might have something else wrong in my form.


My grids are not sorting either anymore (in 7.5.1) they did before the upgrade! I have the set default sort line in a quickformload as well...
[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): 7/6/2025 9:42:54 PM