Sort GridViewComboBoxColumn with multiple columns

2 posts, 0 answers
  1. Eva
    Eva avatar
    3 posts
    Member since:
    May 2015

    Posted 29 Jun 2015 Link to this post

    I have a RadGridView with a GridViewComboBoxColumn. The GridViewComboBoxColumn displays two columns when it drops down. I would like to show headers for each column inside the ComboBox so that the user can sort the lists by either column.

    However, I am unable to display the headers.

    Here is my code:

     

    <telerik:RadGridView Grid.Row="1" Name="mainGridView">
    <telerik:RadGridView.Columns>
    <telerik:GridViewComboBoxColumn UniqueName="NominalAccount" Header="Nominal Account" Width="*" DataMemberBinding="{Binding RefCode}"   ItemsSource ="{Binding NominalAccountsItemList, Mode=TwoWay}"  DisplayMemberPath="DisplayName"  SelectedValueMemberPath="RefCode" >
     <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions >
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Text="{Binding RefCode}" Padding="0,0,6,0"></TextBlock>
                                    <TextBlock Text="{Binding NominalAccountName}"  Grid.Column="1"></TextBlock>
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
         </telerik:RadGridView.Columns>
            </telerik:RadGridView>

     

    Any help on how to get headers for my columns in the dropdown would be much appreciated!

    Thanks in advance

     

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 01 Jul 2015 Link to this post

    Hello,

    GridViewComboBoxColumn itself do not suggest such an in-built option, however, you can customize the column's editor (RadComboBox) or set a specific ItemTemplate (as you already do).
    As to configuring it property, you can refer to the "Drop down with headers" github example.
    Although GitHub is a very well-known platform we saw a better and easier approach for reviewing our examples developing our brand new SDK Samples Browser. You can install it and then use it to review the examples.

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top