WPF を使用して、コンパクト データベースのデータを可変的に表示する TreeView が必要です。つまり、ユーザーがどのように並べ替えたいかに基づいてビューを変更したいと考えています。
データベースに次のテーブルとスキーマがあると仮定すると、どのようにビューを設定できますか? 私が言ったように、それらは可変である必要がありますが、可能であれば複数の HierarchialDataTemplates を検討します。思いつくいくつかの潜在的なビューを以下に示します。
助けてくれてありがとう!
Employee
ID - Int primary Unique AutoIncrement
Name – string
Department - int (foreign relation to Department. ID)
Supervisor - int (ID of Employee in this table)
Division
ID - Int primary Unique AutoIncrement
Name – Unique string
DivisionLeader - int (foreign relation to Employee. ID)
Department
ID - Int primary Unique AutoIncrement
Name – Unique string
DepartmentLeader - int (foreign relation to Employee. ID)
Division – int (foreign relation to Division. ID)
CustomerSupportDepartments
ID - Int primary Unique AutoIncrement
Name – string
Department - int (foreign relation to Department. ID)
Continent - int (foreign relation to Continent. ID)
Country - int (foreign relation to Country. ID)
State - int (foreign relation to State. ID)
City - int (foreign relation to City. ID)
Customer
ID - Int primary Unique AutoIncrement
Name – string
SalesRep - (foreign relation to Employee. ID)
Revenue . int
Continent - int (foreign relation to Continent. ID)
Country - int (foreign relation to Country. ID)
State - int (foreign relation to State. ID)
City - int (foreign relation to City. ID)
Continent
ID - Int primary Unique AutoIncrement
Name – Unique string
Country
ID - Int primary Unique AutoIncrement
Name – Unique string
State
ID - Int primary Unique AutoIncrement
Name – Unique string
City
ID - Int primary Unique AutoIncrement
Name – Unique string
潜在的なビュー
View 1
Employees
Employee Name 1
Supervisor
Name
Department
Name
Customers
Name 1
Name 2
Name 3
Employee Name 2
Supervisor
Name
Department
Name
Customers
Name 1
Name 2
Name 3
View 2
Departments
Department Name 1
Division
Name
Supervisor
Name
Employees
Employee Name 1
Employee Name 2
Department Name 2
Division
Name
Supervisor
Name
Employees
Employee Name 1
Employee Name 2
View 3
Divisions
Division Name 1
Departments
Department Name 1
Department Name 2
Division Name 2
Departments
Department Name 1
Department Name 2
View 4
Continents
Continent Name 1
Country Name 1
City Name 1
Customers
Customer Name 1
Sales Representative
Employee Name
Revenue
Sum
Customer Name 2
Sales Representative
Employee Name
Revenue
Sum
Country Name 2
City Name 1
Customers
Customer Name 1
Sales Representative
Employee Name 1
Revenue
Sum
City Name 2
Customers
Customer Name 1
Sales Representative
Employee Name 1
Revenue
Sum
Customer Name 2
Sales Representative
Employee Name
Revenue
Sum
View 5
Customers
Customer Name 1
Sales Representative
Employee Name
Sales Representative’s Supervisor
Employee Name
Location
Continent
Country
State
City
Revenue
Sum
Customer Name 2
Sales Representative
Employee Name
Sales Representative’s Supervisor
Employee Name
Location
Continent
Country
State
City
Revenue
Sum