parent category>>sub category

Posted by Kashif under C# on 7/19/2013 | Points: 10 | Views : 2072 | Status : [Member] | Replies : 5
Hello,
I m developing application using VS-2005. In this
application i have a dropdownlist.
In dropdownlist i want to display categories, sub-categories,
sub-sub-categories upto any level
(for eg. country--state--district--city--village etc.)
The dropdownlist will look like
Arts
--camera
--photography
----General Photos
----Digital Photos
Company
--employee
----Jr. employee
----Sr.employee
--Manager
----HR manager
----General manager
here i shown categories upto 3 levels but, levels will be 4-5 or more
In database table i have two columns named categoryid(primary key of
categories table) & another one is
parentid(which stores value of main categoryid)
eg. in above dropdown items, categoryid for Arts category is 1 and
parentid
is 0. & parentid of Arts(i.e. 1)
is parentid of camera & photography & like this will continue

if anyone have solution for finding subsub-categories them reply me




Responses

Posted by: Jitendrasoft09 on: 7/19/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Kasif,

Nice question, your solution is in your requirement, you will not create sub menu items for one dropdownlist, take two dropdownlist and in one dropdownlist you keep all items and another you keep all main items, once you will click main items or any level of items, corresponding items to be displayed in another dropdownlist.

And, you will be having the categoryid which will match to parent categoryid table.

Hope you are clear.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Kashif, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kashif on: 7/25/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Jitendra Kumar,

i understand that what u said,,,but it will solve only my dropdown problem,but i also want to show it in gridview field like Men>>clothing>>shirts....
any tutorial?




Kashif, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jitendrasoft09 on: 7/25/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Kashif,

You are right, There is a no problem. you can customize or implement the nested dropdownlist inside gridview according the requirement.

Refer below link for more information-
http://stackoverflow.com/questions/3202260/how-to-implement-nested-dropdownlists-insid-a-gridview-in-asp-net

Hope you have understood.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Kashif, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kashif on: 7/26/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Jitendra Kumar ,


You are not understanding me about gridview i want to display categories like this,,,view the image in below link please

http://i.stack.imgur.com/EpmqL.png

if u can help than it will be gooood ,,because my project is paused due to this problem.
Thanks.
`


Kashif, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jitendrasoft09 on: 7/26/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Kashif,

Please read above link. Your requirement may be not matching to above link. Try to get logic from there. Do not be hurry. take your time to do. Your solution with you. You should be good to write the programming.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Kashif, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response