Infinite Nested DataList Question

P

Paul Hendryx

I have the table structure:

CREATE TABLE [dbo].[tblProductCategory] (
[ProductCategoryID] [int] IDENTITY (1, 1) NOT NULL ,
[ProductID] [int] NOT NULL ,
[ParentProductCategoryID] [int] NULL ,
[Description] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[tblProductCategory] ADD
CONSTRAINT [FK_tblProductCategory_tblProductCategory] FOREIGN KEY
(
[ParentProductCategoryID]
) REFERENCES [dbo].[tblProductCategory] (
[ProductCategoryID]
)
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top