Infinite Product Category Display

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Hendryx

    Infinite Product Category Display

    I have the table structure:

    CREATE TABLE [dbo].[tblProductCateg ory] (
    [ProductCategory ID] [int] IDENTITY (1, 1) NOT NULL ,
    [ProductID] [int] NOT NULL ,
    [ParentProductCa tegoryID] [int] NULL ,
    [Description] [nvarchar] (50) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
    NOT NULL
    ) ON [PRIMARY]
    GO

    ALTER TABLE [dbo].[tblProductCateg ory] ADD
    CONSTRAINT [FK_tblProductCa tegory_tblProdu ctCategory] FOREIGN KEY
    (
    [ParentProductCa tegoryID]
    ) REFERENCES [dbo].[tblProductCateg ory] (
    [ProductCategory ID]
    )
    GO


    My goal is that I want do display this data in a ASP.NET page using
    c#, tho I am confused on HOW to do it. I suppose a tree view like:

    Category
    SubCategory
    SubCategory
    SubCategory2
    Category
    etc.

    I was thinking of using nested DataLists or nested Repeaters with
    infinite levels for this, but I am lost on how to bind data after the
    second level. The first level would have onItemBound where I could
    bind the Level 1 subcategory. How would I go about binding level 2 or
    deeper SubCategories?
Working...