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

Programmatic Grouping by Column bound to data with converter

1 Answer 31 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 06 Aug 2012, 01:09 PM
I am having trouble setting up grouping by a column that is bound to a data element that goes through a value converter.  Below I am trying to group by the Reading Station Column.

<tk:RadGridView Name="RoutesGrid"
            AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True"
            ItemsSource="{Binding PagedSource, ElementName=DataPager}" SelectedItem="{Binding SelectedRoute}"
                        tk:StyleManager.Theme="Summer" MouseRightButtonDown="RadGridView_MouseRightButtonDown">
            <!--<tk:RadGridView.GroupDescriptors>
                <tk:ColumnGroupDescriptor Column="{Binding Columns[\Reading Station\], ElementName=RoutesGrid}" />
            </tk:RadGridView.GroupDescriptors>-->
            <tk:RadGridView.Columns>
                <tk:GridViewDataColumn
					Header="ID"
					DataMemberBinding="{Binding ID}"
					TextAlignment="Center">
                </tk:GridViewDataColumn>
                <tk:GridViewDataColumn 
					Header="Reading Station"
					DataMemberBinding="{Binding ReadingWorkstation, Converter={StaticResource WorkstationToNameConverter}}"
					TextAlignment="Center" Width="Auto">

1 Answer, 1 is accepted

Sort by
0
Accepted
Vera
Telerik team
answered on 07 Aug 2012, 08:41 AM
Hi Jason,

Actually, you are using the value set for the Header property in the ColumnGroupDescriptor definition and this is causing the problem. What you can do is either set the UniqueName property, or to directly use the name of the property - in your case  ReadingWorkStation.

I hope this helps.

Greetings,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Jason
Top achievements
Rank 1
Answers by
Vera
Telerik team
Share this question
or