This question is locked. New answers and comments are not allowed.
Is there a simple way to have expandable rows in a GridView. For example, I want to display 2 of 3 properties of an object in the grid, but want the 3rd one to appear when the user clicks the row...or clicks a plus sign on the left (either way)?
With the Silverlight Toolkit grid it is incredibly easy:
<datagrid:DataGrid x:Name="dataGrid" ItemsSource="{Binding}">
<datagrid:DataGrid.RowDetailsTemplate>
<DataTemplate>
<TextBlock Text="{Binding MyThirdProperty}" />
</DataTemplate>
</datagrid:DataGrid.RowDetailsTemplate>
</datagrid:DataGrid>
I've simplified this code a bit (I would actually have to define the first two columns manually), and I know they are not using animations to make it slide down smoothly, but this is something that should be really simple for a developer to achieve. I've been looking at some of the code in your samples and it is incredibly complex. Tons of lines of code to set up a row style and a bunch of supporting methods in the code-behind...including some really, really ugly code like this:
I'd just go ahead and use the Silverlight Toolkit DataGrid, except that I need the filtering capability that you guys offer.
Thanks,
Ross
With the Silverlight Toolkit grid it is incredibly easy:
<datagrid:DataGrid x:Name="dataGrid" ItemsSource="{Binding}">
<datagrid:DataGrid.RowDetailsTemplate>
<DataTemplate>
<TextBlock Text="{Binding MyThirdProperty}" />
</DataTemplate>
</datagrid:DataGrid.RowDetailsTemplate>
</datagrid:DataGrid>
I've simplified this code a bit (I would actually have to define the first two columns manually), and I know they are not using animations to make it slide down smoothly, but this is something that should be really simple for a developer to achieve. I've been looking at some of the code in your samples and it is incredibly complex. Tons of lines of code to set up a row style and a bunch of supporting methods in the code-behind...including some really, really ugly code like this:
FrameworkElement mainGrid =
(FrameworkElement)((FrameworkElement)((FrameworkElement)((FrameworkElement)frameworkElement.Parent).Parent).Parent).Parent;
RunAnimation(mainGrid, "hideDetails", GetHeightsSynchronizer(mainGrid));
I'd just go ahead and use the Silverlight Toolkit DataGrid, except that I need the filtering capability that you guys offer.
Thanks,
Ross