Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, June 30, 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: Enabling Paging and Sort on Datagrid and GetByMethod
John
Posts: 34
 
Enabling Paging and Sort on Datagrid and GetByMethodYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 10 7:44 AM
Hello everyone,

Actually, I'm populating the grid when i click on a refresh button by code using a BR. So, my question is if it is posible that the default Sort and Paging works, or do i have to do some extra coding or configuration for it to work. If that the case can someone pont me to the right direction.

Thanks a lot,

John
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Enabling Paging and Sort on Datagrid and GetByMethodYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 10 11:11 AM
Hi,

Default paging and sorting should continue to work fine.

Unless your BR is returning some funny objects...if it is you wil get an error when you try to sort on that property. What is the BR?

Thanks,
Nick
[Reply][Quote]
John
Posts: 34
 
Re: Enabling Paging and Sort on Datagrid and GetByMethodYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 10 6:58 AM
In fact, the BR its not returning anything.
Im setting the datasource through code.
I did this because i had a huge SQL query and i wasn't able to do it with NHibernate

System.Data.DataTable oDataTable = account.GetBinderSummary(from, to, callerEntity, isContact) as System.Data.DataTable;
System.Collections.Generic.IList sa = new System.Collections.Generic.List();
Sage.Entity.Interfaces.ICSystemAbstract02 saItem;

decimal? currentPremium = 0;
decimal? expSubmissionPolicyPremium = 0;
DateTime? boundDate = null;
DateTime? policyEffectiveDate = null;
DateTime? policyExpirationDate = null;

if (oDataTable != null)
{
foreach (System.Data.DataRow dr in oDataTable.Rows)
{
saItem = Sage.Platform.EntityFactory.Create();

currentPremium = Convert.ToDecimal(dr["CurrentPremium"]);
expSubmissionPolicyPremium = Convert.ToDecimal(dr["ExpSubmissionPolicyPremium"]);
policyEffectiveDate = CheckForNullDate(dr["PolicyEffectiveDate"]);
policyExpirationDate = CheckForNullDate(dr["PolicyExpirationDate"]);
boundDate = CheckForNullDate(dr["BoundDate"]);

saItem.HouseNumber = dr["HouseNumber"].ToString();
saItem.SubmissionNumber = dr["SubmissionNumber"].ToString();
saItem.PolicyTypeCode = dr["PolicyTypeCode"].ToString();
saItem.NewOrRenew = dr["NewOrRenew"].ToString();
saItem.Insured1 = dr["Insured1"].ToString();
saItem.BoundDate = boundDate;
saItem.PolicyEffectiveDate = policyEffectiveDate;
saItem.PolicyExpirationDate = policyExpirationDate;
saItem.SubmissionStatusCode = dr["SubmissionStatusCode"].ToString();
saItem.Underwriter = dr["Underwriter"].ToString();
saItem.LOB = Convert.ToString(dr["C_LOB"]);
saItem.DOB = dr["C_DOB"].ToString();
saItem.CurrentPremium = currentPremium;
saItem.ExpSubmissionPolicyPremium = expSubmissionPolicyPremium;

if (saItem != null) sa.Add(saItem);
}
}
}
Sage.Platform.Controls.IDataGridControl grd = grid as Sage.Platform.Controls.IDataGridControl;

if (grd != null)
{
grd.DataSource = sa;
grd.DataBind();
}
}

private static DateTime? CheckForNullDate (object value)
{
if (value == null || value == "" || value == System.DBNull.Value)
return null;
return Convert.ToDateTime(value);
}
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Enabling Paging and Sort on Datagrid and GetByMethodYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Mar 10 8:16 AM
Sorry this one has been here a while...anyway if you are binding to an Ilist as long as your columns are all part of the "base" entity that the grid is bound to it should be fine. It looks like they are. When I say "base" I mean not joining to another entity. As has been mentioned before (something to with lazy loading in SLX (im paraphrasing here, see Mark Dykun's interesting post: http://codesnap.wordpress.com/2009/05/05/unwrap-that-object-my-friend/ ) if you join to a child property it cannot be resolved when trying to sort so you get an error something like "property X is not found in entity Sage.Entity.Interfaces.ICUSTOMENTITY".

THis doesnt seem like the most economical way of achieving the functionality you want (there MUST be an overhead in calling an EntityFactory.Create for every row in the grid). If you have the SQL why not just create a SQLDataSource, set its SelectCommand, its connection string and its type and set the grid to the datasource and bind it. That way too for sure the sorting and paging will work.

Thanks,
Nick
[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/30/2025 6:27:31 PM