0

Say the object is as follows:

string Name
Dictionary<string,bool> Tags

Where tags is dynamic, but there is a list of tags stored in a Collection in the core data object.

I want to be able to display this in a datagrid like so:

Name  tag1  tag2 tag3
Bob   true  true
John  true       true

I left out false, but that could be in there if needed.

Cheers

4

1 に答える 1

0

Tags コレクションの各キーがプロパティになるプロジェクションを動的に作成する必要があるため、実際には LINQ でこれを直接行うことはできません。

タグ (および Name プロパティ) に対応する列と、所有するクラスのインスタンスに対応する行を使用して、DataSet を作成することをお勧めします。

于 2009-02-09T03:52:24.663 に答える