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

Sort on ComboBox selected value

3 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 17 Mar 2011, 03:01 PM
Is it possible to sort on the selected value in the combobox that I've implemented like this?
<telerik:GridViewColumn  UniqueName="Responsible" Header="Responsible" IsGroupable="False" MinWidth="150">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <ComboBox ItemsSource="{Binding DepartmentEntities}" SelectedValuePath="Id" DisplayMemberPath="Name"  SelectedItem="{Binding SelectedDepartment, Mode=TwoWay}" MinWidth="150">
                            </ComboBox>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn >

Kind Regards, 
John

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 17 Mar 2011, 03:11 PM
Hi John,

Generally, you have to define the DataMemberBinding property of the column in order to enable sorting out-of-the-box (you need to use GridViewDataColumn instead). On the other hand, you may benefit directly form the GridViewComboBoxColumn. If you want to sort it based on the displayed value, you may take a look at this forum thread.

All the best,
Maya
the Telerik team
0
John
Top achievements
Rank 1
answered on 17 Mar 2011, 03:21 PM
The reason why I have a combobox in a datatemplate like that, is because I wanna avoid having to double click in order to modify a value in a GridViewComboBoxColumn. This might be better to take in a new thread, but is it possible to turn that off?
0
Accepted
Maya
Telerik team
answered on 17 Mar 2011, 03:29 PM
Hi John,

You may take a look at this forum thread for a reference.
 

Regards,
Maya
the Telerik team
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Maya
Telerik team
John
Top achievements
Rank 1
Share this question
or