开发者

howto create dynamic gridview in a listview item in wpf

开发者 https://www.devze.com 2023-01-18 09:26 出处:网络
This is the situation: I\'ve got a listview with some item. Each of these item have got an other list, and I would like to show this list in a gridview.

This is the situation:

I've got a listview with some item. Each of these item have got an other list, and I would like to show this list in a gridview.

So I'd like to show the main listview with expanders, and if the user 开发者_JS百科expand one of this item, it will show the other list in a gridview.

The problem is that, the gridview must be a dynamic, because the properties of the item is dynamic.

Could You give me some idea, how to create a gridview with dynamic columns in a listview item.

There is an illustration :D :

Mainlist with expanders:

->mainitem1

->mainitem2 (this is expanded :) )

 Column1   Column2  Column3
property1 property2 property3   (other list first item properties)
property1 property2 property3   (other list second item properties)
property1 property2 property3   (other list third item properties)
property1 property2 property3   (other list fourth item properties)

->mainitem3

I hope you understand it :) .

Thanks in advance for every comment!

Regards, Zoli


I would suggest using the wpf DataGrid.

You could use it for the whole solution or just the inner ListView could be a DataGrid. The DataGrid can automatically generate the columns for you, and you can set it to be read-only so it will behave similiar to a ListView.

0

精彩评论

暂无评论...
验证码 换一张
取 消