tags:

views:

53

answers:

1

Hi!

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 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

A: 

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.

Kelly
Thanks, it's solved my problem, but I have to create the AutoGeneratedColumn event, because my properties in a List, and I have to dynamically add the columns to the datagrid in codebehind.
Zoltán Barna