c# - Hierarchical data in a drop-down list on Dynamic Data site -


I am getting into dynamic data sites (notably powerful), and enjoying it. However, I have a requirement that I do not want to meet. I have got myself joining range table (ID, name, parent ID) to create hierarchical category structure (for example, categories with the Null ID, top level, common type of thing). Then I have a product table that has a foreign key for the class.

Within the dynamic data site, I have a category dropdown list automatically generated; Although it only lists all the categories in numerical order what I would like (and which I have coded before, pre-dynamic data) is an indent list, the list of sort order of categories.

Do I Replace Existing FilterUserControl? Can I override the populatelight control method anywhere?

Just be prompt and advice, thanks for any help offered.

Kind regards,

  SELECT LEVEL, ID, name, LPAD ('', level) || Started with the name of the pen named Indented by name starts with ParentID = PRIOR ID, the name of centric name white name  

You can use IndentedName Or you have level pseudocolumn (this shows the depth of each category depending on the custom formatting)

PS it as the top code of NULL There is a bad idea to use, because you can access it to index Defense can not use. Instead use 0 .

Update:

In these SQL Server :

(Previously, id, parent, name, level, BC (AS) with SELECT id, parentid, name, 1, CAST (ROW_NUMBER) (as VARCHAR (MAX)) from WHERE ParentID IS NULL UNION ALL Select c.id, c.parentid, C.name, q.level + 1, q.bc + '.' + CAST (ROW_NUMBER ()) (c.name by ORDER) AS VARCHAR (MAX)), select c. ParentId = q.id on C Join Categories C * from BC

Q Orders> Oracle , SQL Server indexed NULL value, so using NULL to mark a last ancestor possible.


Comments