Bind DropDownList with Hierarchy from SQL Server Table with ASP.NET -
i have following sql table contains menu (website menu) data.
table name: menuitems
columns: id, menuid, parentmenuitemid, text.
my goal bind ddl according following hierarchy (example):
id: 1, menuid: 1, parentmenuitemid: -1, text: 'one' id: 2, menuid: 1, parentmenuitemid: 1, text: 'two' id: 3, menuid: 1, parentmenuitemid: 1, text: 'three' id: 4, menuid: 1, parentmenuitemid: 2, text: 'four' id: 5, menuid: 1, parentmenuitemid: 4, text: 'five'
requested result in ddl:
one -- 2 ---- 4 ------ 5 -- 3
i think should contain with
sql command.
note: i'm using c#.
i didn't issue. facing problem in traversing hierarchy using sql command or issue show hierarchy in dropdown??? if first case there many stored procedures available traverse hierarchies , if second case:
i don't think normal dropdown can show multilevel hierarchy in it.. can support 2 level hierarchy(called grouping).. better try treeview show such data.
but if want solution in dropdown try this: http://www.givainc.com/labs/mcdropdown_jquery_plugin.htm
regards.
Comments
Post a Comment