This is a migrated thread and some comments may be shown as answers.

Hide repeated row values

3 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Boardy
Top achievements
Rank 1
Veteran
Boardy asked on 13 Jun 2014, 08:06 AM
Basically I have a parent-child situation I want to display in a flat grid. But for a series of consecutive rows with the same parent, I only want the first row to show the parent values.

It is basically the same as this question, but for WPF instead of WinForms.

How is it possible to achieve this?

3 Answers, 1 is accepted

Sort by
0
Accepted
Nick
Telerik team
answered on 16 Jun 2014, 09:49 AM
Hello ,

Due to differences in the platforms, the approach shown for the WinForms RadGridView, will not work with RadGridView for WPF. Manipulating the visual data in the cells will result in obscure display data when scrolling due to the UI Virtualization mechanism of RadGridView. 

You can try manipulating the display value via binding converters, depending on the values shown in the Business objects.

Hope this helps. 

Regards,
Nik
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Boardy
Top achievements
Rank 1
Veteran
answered on 17 Jun 2014, 12:18 PM
The following seems to work:
<rv:RepeatedConverter x:Key="cnvRpt" />
<Style x:Key="stlRepeatedRow" TargetType="telerik:GridViewCell">
    <Style.Triggers>
        <DataTrigger Value="true">
            <DataTrigger.Binding>
                <MultiBinding Converter="{StaticResource cnvRpt}">
                    <Binding />
                    <Binding RelativeSource="{RelativeSource AncestorType=Window}" />
                </MultiBinding>
            </DataTrigger.Binding>
            <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource Self}, Path=Background}" />
        </DataTrigger>
    </Style.Triggers>
</Style>

And when setting this style to a column, the converter can get the predecessor via the window and compare it with the actual item. I don't really like the way the value is hidden (by applying the background brush to the foreground), but it works.

Thanks for your help.
0
kity
Top achievements
Rank 2
answered on 07 Aug 2014, 12:49 PM
Make new boolean property in your binding collection
bool: Visible{ge;set;}

Place in gridview and done.

‚Äč<telerik:RadGridView.FilterDescriptors>
<data:CompositeFilterDescriptor LogicalOperator="Or">
<data:CompositeFilterDescriptor.FilterDescriptors>
<data:FilterDescriptor Member="Visible" Operator="IsEqualTo" Value="True" />
</data:CompositeFilterDescriptor.FilterDescriptors>
</data:CompositeFilterDescriptor>
</telerik:RadGridView.FilterDescriptors>
Tags
GridView
Asked by
Boardy
Top achievements
Rank 1
Veteran
Answers by
Nick
Telerik team
Boardy
Top achievements
Rank 1
Veteran
kity
Top achievements
Rank 2
Share this question
or