Hi,
I have the following db structure (simplified):
Element (hierarchical)
ElementItem (many to many, clustered PK (ElementId, ItemId), FK(ElementId), FK(ItemId))
Item
when I try building a hierarchical master detail page, radzen only offers the follwing child data
- Elements
- ElementItems
How to get Item into the game?
Scheme:
CREATE TABLE [Info].[Element] (
[ElementId] INT NOT NULL,
[ElementParentId] INT NULL,
[Name] NVARCHAR (150) NOT NULL,
CONSTRAINT [PK_Element] PRIMARY KEY CLUSTERED ([ElementId] ASC),
CONSTRAINT [FK_Element_ElementParent] FOREIGN KEY ([ElementParentId]) REFERENCES [Info].[Element] ([ElementId]),);
CREATE TABLE [Info].[ElementItem] (
[ElementId] INT NOT NULL,
[ItemId] INT NOT NULL,
CONSTRAINT [PK_ElementItem] PRIMARY KEY CLUSTERED ([ElementId] ASC, [ItemId] ASC),
CONSTRAINT [FK_ElementItem_Element] FOREIGN KEY ([ElementId]) REFERENCES [Info].[Element] ([ElementId]),
CONSTRAINT [FK_ElementItem_Item] FOREIGN KEY ([ItemId]) REFERENCES [Info].[Item] ([ItemId])
);
CREATE TABLE [Info].[Item] (
[ItemId] INT NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
CONSTRAINT [PK_Item] PRIMARY KEY CLUSTERED ([ItemId] ASC),
);
It seems that radzen does not recognize that ElementItem is the linking table in a many to many relationship. Or am I doing anything wrong?
Kind regards,
Marc