I have a WPF GridView
, and part of the data needs to be shown in the Totals (both Footer and Group totals), but not in the actual data records.
I thought it would be easy to write a trigger and hide the row based on the row's data, however it turns out that Telerik's GridView
uses an unusual panel for virtualization, so although the specified rows get hidden, a blank white space is left where it should go.
Here's my current style. It does hide the row, but it is the equivalent to making the visibility Hidden
instead of Collapsed
(hides the item, but leaves white space where it is)
<Style TargetType="{x:Type telerik:GridViewGroupRow}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding Group.Key, RelativeSource={RelativeSource Self}}" Value="SomeValue">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
I have tried setting the ItemTemplate to null, removing the Item from the Telerik's GridViewVirtualizingPanel, and adjusting the Visibility, but none of these options seem to work.
Does anyone know of a way I could accomplish this? I either want to hide (and collapse) the rows based on a trigger, or find a way to get the query of the current Grouped Expression so I can query a 2nd collection and display the results in the Group Total. I have no problem with using Code-Behind or something hackish to accomplish this.
Edit
As an interesting side note, I can set the height to 1, but not 0. Even 1 is too much though, since I can be hiding thousands of records and this leaves a huge white area on the screen.