Data Access Layer and GridView for foreign key values

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Data Access Layer and GridView for foreign key values

Post by ZLA » Wed Jun 03, 2009 7:50 am

Is there a standard way to display foreign key values in a Gridview using generated data access classes? I want to be able to sort on the displayed value (a field in the foreign key table), not the foreign key itself.

Do I just change the LoadForWhatever routines to include the foreign key columns or do I need to change the class's underlying column names?

Thanks.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Data Access Layer and GridView for foreign key values

Post by mazhar » Wed Jun 03, 2009 8:16 am

This sort of operation will need SQL JOIN or more complex queries. LoadForCriteria is designed for simple queries involving just single table. In your case you can write your custom load method with your complex SQL query and then use that method for your custom sorting etc.

Post Reply