0

So i have a datagrid that was built with the mindscape datagrid control that looks like this:

I am not sure if i will be able to do this to the mindscape control, so this will be a question about any multi-column listview or datagrid.

When an item is clicked, and selected, I need to expand the item (hopefully with an animation/storyboard) downwards, to display a bunch of extra information about the item (rating graph, list of available locations, etc).

I honestly have no idea how to begin with this. I'm new to wpf. in winforms i would just create a custom listboxitem that controls it's own height, and listen to the selected event.

caesay
  • 16,932
  • 15
  • 95
  • 160
  • Don't use a `ListView`. Use a [`DataGrid`](http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid(v=vs.110).aspx) and lookup its [`RowDetailsTemplate` property](http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.rowdetailstemplate(v=vs.110).aspx) in MSDN. Your required functionality is built in to the `DataGrid`. – Sheridan Jun 09 '14 at 15:32
  • @Sheridan: Thanks! that should be an answer though :p – caesay Jun 09 '14 at 15:38
  • This comment is a bit short for an answer, @caesay. I'll buff it out and add it as an answer. – Sheridan Jun 09 '14 at 16:00

1 Answers1

0

A ListView is not the best control to use for your requirements. Instead of the ListView, you should use a DataGrid control. Your required functionality is built in to the DataGrid as it has a row details section... from the DataGrid.RowDetailsTemplate property page on MSDN.

You can customize the data presentation in the DataGrid by adding a row details section. Adding a row details section enables you to group some data in a template that is optionally visible or collapsed.

You define the row details template as either inline XAML or as a resource. A data template that is added as a resource can be used throughout the project without re-creating the template. A data template that is added as inline XAML is only accessible from the control where it is defined.

Community
  • 1
  • 1
Sheridan
  • 68,826
  • 24
  • 143
  • 183