Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I have created a page in my website where I have to display all the categories with its corresponding sub categories with their images.

Suppose I have 10 Main categories and under main categories there are sub categories for each main category. And in each main category there are 5-20 sub categories.

The problem is that I have three columns and when I display first main category with its 20 sub categories and then second main category with 5 sub categories in my first column and then my second column starts and when I display third main category with only 3 sub categories then my third main category (which has only 3 sub categories) leaves the 17 rows space because in first column the first main category took 20 rows so it leaves 17 rows blank and starts my fourth category after black 17 rows. As you could see below :


(Food Main Category Heading)


  I column                                II Column                        III column
Food subcategories                        Breakfast
Baby Food
                                          Cold Cereals                         and sub-sub categories list
    1,031                                       91
1ST Stage Baby Food                      Dips and Spreads
    172                                         117
2ND Stage Baby Food
    418
3RD Stage Baby Food
    179
Baby Cereal
    82
Baby Formula
    148
Baby Juice
    47




Breakfast                             Frozen Foods


Cold Cereals                           and sub-sub categories list starts
    1,031
Granola
    195
Hot Cereals
    542
Toaster Pastries
    180

Candy                                  Dairy & Dairy Substitutes

Boxed Candy                            and sub-sub categories list
    691
Candy Bar                               starts 
    712
Chocolate Bar
    578
Dessert Toppings
    177
Hard Candy
    408
Soft Candy
    331


Canned Foods

Broth
    149
Fruits
    305
Meats
    82
Seafood
    557
Soups
    646
Vegetables
    1,223


Dairy & Dairy Substitutes


Desserts
    2,037
Hard Cheese
    805
Milk
    420
Milk Substitutes
    306
Yogurt
    1,526


I just want to start my fourth category exactly from the next row appearing in my second column after third category without leaving any row as blank. I am using data list and grid view controls.

Any Help is appreciated. Thanks in advance.
Posted
Updated 18-May-13 1:12am
v2

Dear Friend,

I don't know which control you are using but i hope the tree view control will definitely help you out.

treeview in c#.net

Please don't forget to mark this as your answer if it helps you out.

Thanks & Regards

Varun Sareen
 
Share this answer
 
Comments
winners6 17-May-13 6:54am    
I am using grid view and data list control. which always list items in tabular format and tabular format always runs in fixed row count fashion. So if there are 20 rows in first column then it will also take 20 rows in second column and vice verca. So the solution is required for data list and grid view controls.
hi winners6269


I unable to get what exactly u need but here i have list of ideas which may help's you:

http://www.trirand.net/examples/tree/textandimages/default.aspx[^]

http://www.trirand.net/examples/grid/treegrid/loadallrowsexpanded/default.aspx[^]

If any of this link help's u let me know.

Regards,
jsm
 
Share this answer
 
Comments
winners6 17-May-13 6:54am    
I am using grid view and data list control. which always list items in tabular format and tabular format always runs in fixed row count fashion. So if there are 20 rows in first column then it will also take 20 rows in second column and vice verca. So the solution is required for data list and grid view controls.
Varun Sareen 18-May-13 8:36am    
i think the link below

http://www.trirand.net/examples/grid/treegrid/loadallrowsexpanded/default.aspx[^]

is the answer to the problem by you.

Nice answer JSM.
manoj.jsm 18-May-13 9:12am    
hi Varun Sareen,

Thanks Bro. and also i had reread many of your answer they where well defined and apt to the questions. anyway nice knowing you.

Regards,
Manoj.jsm
Varun Sareen 20-May-13 7:15am    
thanks dear :-) its glad that you remember me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900