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

GridViewComboBox vs Combobox IsReadOnly

3 Answers 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 10 Apr 2015, 03:13 PM

I'd like to duplicate the functionality of the Combobox in the grid. If IsComboBoxEditable is set to True and is IsReadOnly is set to True, it disable selecting anything in the column. What i really want is the ComboBox behavior IsEditable="True" IsReadOnly="True" allows you to type but only will select value rows.

How do I accomplish this? 

3 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 10 Apr 2015, 05:18 PM
*only select "valid" rows. If the value isn't in the list, you can't type those letters. Just like the ComboBox Edit Mode demo.
0
Accepted
Stefan
Telerik team
answered on 13 Apr 2015, 03:23 PM
Hello Michael,

A way of achieving this is by following these steps:

1.   Define a style as a static resource which targets RadComboBox:
<Style x:Key="comboStyle"
       TargetType="telerik:RadComboBox">
    <Setter Property="IsEditable"
            Value="True"/>
    <Setter Property="IsReadOnly"
            Value="True"/>
</Style>

2.   Apply the style to the editor of GridViewComboBoxColumn through the EditorStyle property:
<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding Name}"
                                IsComboBoxEditable="True"
                                ItemsSource="{Binding Players}"
                                EditorStyle="{StaticResource comboStyle}"/>


Please, give the approach a try and let me know how it works for you.

Best Regards,
Stefan
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Michael
Top achievements
Rank 1
answered on 13 Apr 2015, 04:54 PM
Perfect. Thanks.
Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or