Combining 2 specific rows

2 posts, 0 answers
  1. Jasper
    Jasper avatar
    1 posts
    Member since:
    Jul 2013

    Posted 22 Jul 2013 Link to this post

    Hi,

    I have a RadGridView control which is filled with databinding. The source data contains 'datasets' which have the property "Type". These Types are unique for each dataset. The gridview looks like this:

    <telerik:RadGridView Grid.Row="0" ItemsSource="{Binding DataSets}" SelectedItem="{Binding SelectedDataSet, Mode=TwoWay}" BorderThickness="0"
                                 AutoGenerateColumns="False" IsReadOnly="True" ShowGroupPanel="False">
                <i:Interaction.Behaviors>
                    <gri:RadGridViewFilterBehavior Expression="{Binding FilterExpression, Mode=TwoWay}">
                        <gri:RadGridViewFilterBehavior.FieldNameSupplier>
                            <filtering:DataSetFieldNameSuplier />
                        </gri:RadGridViewFilterBehavior.FieldNameSupplier>
                        <gri:RadGridViewFilterBehavior.TypeResolver>
                            <filtering:DataSetTypeResolver />
                        </gri:RadGridViewFilterBehavior.TypeResolver>
                    </gri:RadGridViewFilterBehavior>
     
                    <gri:RadGridViewSortBehavior Sort="{Binding SortExpression, Mode=TwoWay}">
                        <gri:RadGridViewSortBehavior.FieldNameSupplier>
                            <filtering:DataSetFieldNameSuplier />
                        </gri:RadGridViewSortBehavior.FieldNameSupplier>
                    </gri:RadGridViewSortBehavior>
                </i:Interaction.Behaviors>
     
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.Name, Source={StaticResource strings}}" DataMemberBinding="{Binding Name}" />
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.Type, Source={StaticResource strings}}" DataMemberBinding="{Binding Type}" />
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.Officer, Source={StaticResource strings}}" DataMemberBinding="{Binding Officer}" />
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.StartDate, Source={StaticResource strings}}" DataMemberBinding="{Binding StartDate}" DataFormatString="dd-MM-yyyy" />
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.EndDate, Source={StaticResource strings}}" DataMemberBinding="{Binding EndDate}" DataFormatString="dd-MM-yyyy" />
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.CreationDate, Source={StaticResource strings}}" DataMemberBinding="{Binding CreationDate}" DataFormatString="dd-MM-yyyy hh:mm" />
                    <telerik:GridViewDataColumn ShowDistinctFilters="False" Header="{Binding Resource.Description, Source={StaticResource strings}}" DataMemberBinding="{Binding Description}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

    I want to 'group' two specific rows, lets say with types Type2A & Type2B.
    It should look like this:

    • Type1
    • Type2
    • A
    • B
    • Type3

    I looked at grouping for GridViews but this always seems to apply to all rows, not to just 2 specific rows.

    My question:

    Is it even possible to do this?
    If so, how?
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Jul 2013 Link to this post

    Hi,

    The way to write your custom grouping expression would be to use a generic GroupDescriptor. You can try grouping the items as you would like to.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top