|
-
May 29th, 2003, 11:00 AM
#1
Thread Starter
Member
Specialized Datagrid Formatting in ASP.Net...
Hi there,
I developed a small app that used a datagrid to display categories. When the user clicks on a particular category a datalist below displays the products in that particular category. Everything works great.
However, a seemingly small modification was requested - the Categories must be displayed max three to a column spreading across the page as follows (see image below).
Does anyone have any idea if the datagrid control can be manipulated in such a way and how is it done? Or, does anyone have a suggestion on how I can acomplish this. I'm hoping I don't have to rework everything - any help would be much appreciated.
Thanks.
-Rich
-
May 29th, 2003, 12:12 PM
#2
PowerPoster
The datagrid doesn't support that type of functionality unless you do all the work setting up the dataset before hand. But, there is a component that is specifically designed to do exactly what you want. It is the datalist control. You can set its RepeatColumns property to 3 to get your desired effect. This control requires a little more work with the GUI part of it, but really isn't to big of a deal.
I recommend you pick up this book:
ASP.NET Data Web Controls Kick Start by Scott Mitchell
It goes through everything you need with the datagrid, datalist, and datarepeater controls. I HIGHLY recommend this book for any asp.net developer. It has been one of the few books that are actually work the money.
-
May 29th, 2003, 12:23 PM
#3
Thread Starter
Member
Thank you Hellswraith!
That puts me on the path in the right direction. Thanks for the tip on the book - I was looking for a good ASP .Net book - one that is a good reference tool.
-Rich
-
May 29th, 2003, 12:28 PM
#4
PowerPoster
That book just covers the datagrid, datalist, and datarepeater. Don't mistake it for an all around asp.net book...k.
With that said though, it takes the limited subject of those three controls, and does it REALLY well.
-
May 29th, 2003, 01:26 PM
#5
Thread Starter
Member
Yeah, thanks for the clarification. Those three controls are pretty versitile though. If you can master those you can pretty much do most tasks concerning data manupulation and display in ASP.net.
-
May 29th, 2003, 01:34 PM
#6
PowerPoster
I agree. I didn't know just how versitile they really were until I got a hold of that book. I was creating tables in code and such to get different effects resulting in a lot of code to do the same thing I can do with those controls in under 10 lines of code..lol.
Good luck.
-
May 29th, 2003, 03:10 PM
#7
Thread Starter
Member
Thanks!
The Datalist worked great. It took a little bit to get the ItemCommand event to pass the right info to get the right products for the right category - but its working now - just the way they wanted it!! Cool! I was hoping I wouldn't have to create a table and loop through the way we used to do it in ASP.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|