Hide repeated row values

4 posts, 1 answers
  1. Boardy
    Boardy avatar
    14 posts
    Member since:
    Mar 2010

    Posted 13 Jun 2014 Link to this post

    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?
  2. Answer
    Nick avatar
    593 posts

    Posted 16 Jun 2014 Link to this post

    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. 

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Boardy
    Boardy avatar
    14 posts
    Member since:
    Mar 2010

    Posted 17 Jun 2014 in reply to Nick Link to this post

    The following seems to work:
    <rv:RepeatedConverter x:Key="cnvRpt" />
    <Style x:Key="stlRepeatedRow" TargetType="telerik:GridViewCell">
            <DataTrigger Value="true">
                    <MultiBinding Converter="{StaticResource cnvRpt}">
                        <Binding />
                        <Binding RelativeSource="{RelativeSource AncestorType=Window}" />
                <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource Self}, Path=Background}" />

    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.
  5. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 07 Aug 2014 in reply to Boardy Link to this post

    Make new boolean property in your binding collection
    bool: Visible{ge;set;}

    Place in gridview and done.

    <data:CompositeFilterDescriptor LogicalOperator="Or">
    <data:FilterDescriptor Member="Visible" Operator="IsEqualTo" Value="True" />
Back to Top