Programmatic Grouping by Column bound to data with converter

2 posts, 1 answers
  1. Jason
    Jason avatar
    15 posts
    Member since:
    Jul 2010

    Posted 06 Aug 2012 Link to this post

    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:ColumnGroupDescriptor Column="{Binding Columns[\Reading Station\], ElementName=RoutesGrid}" />
    					DataMemberBinding="{Binding ID}"
    					Header="Reading Station"
    					DataMemberBinding="{Binding ReadingWorkstation, Converter={StaticResource WorkstationToNameConverter}}"
    					TextAlignment="Center" Width="Auto">
  2. Answer
    Vera avatar
    268 posts

    Posted 07 Aug 2012 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top