SortedGridView help

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

SortedGridView help

Post by heinscott » Thu May 01, 2008 12:47 pm

Hello. I am new to Able Commerce, and I am currently working on customizing the admin end of AC to fit our store needs. That being said, I love the way everything is laid out, and how easy everything is to work with. So, I was wondering if perhaps anyone has run into this...
I need to create a custom display (for example, the lowInventory report is almost what I need), but need to add some fields like "ProductManufacturer" and a Check-Box that, when checked, will add my selected Items to a PO table. Now, I know how to do all this, but, the problem I am running into is using the very nicely laid out <cb:sortedGridView> to accomplish this. Is there any way that anyone has come up, to include my own data source for this SortedGridView element? I am attempting to create a custom class to select the appropriate data, but, am not sure what all methods with what parameters all need to be included.
Is there perhaps even some kind of resource to help with this??
Thank you all for any help you can give me. I love this product, and am really excited about continuing to work with, and understand more of it.
All the best

Scott

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: SortedGridView help

Post by AbleMods » Thu May 01, 2008 10:11 pm

Take a look at the ~/Admin/Orders/Default.aspx page. It's thick, but it gives a good example of how Able uses the CBGridView control to display both fields from a table and an additional checkbox that's not part of the table. I think this is similiar to the route you are wanting to go.

You'll notice in the code file there is a function that facilitates the checkbox functionality. GetSelectedOrderIds is called to build the list of OrderIds that have the checkbox checked.

If you want several custom fields in the gridview, you're going to pretty much have to build your own data class. If that's where you're struggling, better pick up a good book on introductory .Net 2.0 data class design before you get started. Learning it through the school-of-hard-knocks will take you 4x as long and set you up for some really bad design habits. Trust me on that one :wink:
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: SortedGridView help

Post by heinscott » Fri May 02, 2008 7:41 am

Hey, thank you for the reply! Yes, I definitely need custom fields to show on the page. For instance, right now I am modifying the LowQuantity Report. I have added a table to the DB that links Vendors and Items, so that I can have multple Vendors offering the same products. On this report, I want the Vendor with the lowest price on a low quanity item to show on this report, so that I can add it to a purchase order. It's easy enough to do all of this, querying the DB directly, and populating a grid. I just like the way that the Able Commerce grid looks, as well as having the sort functionality built in.
If I need to create a data class, I can definitely do that. I just wanted to know what methods this class needed to have in order to work with the cb:SortedGridView. Are they standard methods for a data class? You're right... right now I'm unfamiliar with these conventions in ASP .net, and if picking up a resource book might help me with all this, I have no problem with that!
Thanks again for the help.

Scott

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: SortedGridView help

Post by AbleMods » Fri May 02, 2008 8:25 am

No problem.

Try doing it with the standard .Net GridView control first and learn from the book material. The Wrox series of .Net 2.0 books are quite good. Can't miss them on the shelf, always have a big red cover on them. The time investment will be well worth it because the knowledge gained will be very useful as you move forward.

You don't want to try starting a Quantum Mechanics 301 class right after finishing Calculus 101. You could do it, but man is there a painful learning curve ahead :)

I was in your boat 9 months ago. I wasted many, many days of hard work trying to make something work via the brute-force method. This just left me frustrated and discouraged - not a good mental state when it comes to programming. Had I just stopped and taken the time to read up on the technology better, I would have gained the foundation knowledge much sooner and made far better progress.

Hindsight is always 20/20 8)
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply