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

RadGridView in Item Template

1 Answer 302 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Glenn
Top achievements
Rank 1
Glenn asked on 15 Aug 2016, 08:49 AM

I've placed a RadGridView in the items control template of my combobox. It's working fine with the exception of the filtering, which is a bit "clunky". The gridview displays when clicking on the dropdown button, but when I enter some text, the grid closes and only re-opens (with the new filtered dataset) after clicking twice on the dropdown.

Any ideas?

 

XAML:

<tk:RadComboBox Width="200" Text="{Binding ComboText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" OpenDropDownOnFocus="True" StaysOpenOnEdit="True" IsFilteringEnabled="True" IsEditable="True" >
<tk:RadComboBox.Items>
<tk:RadComboBoxItem>
<tk:RadComboBoxItem.Template>
<ControlTemplate>
<tk:RadGridView ItemsSource="{Binding MatterList}" SelectedItem="{Binding SelectedMatter}" IsReadOnly="True" AutoGenerateColumns="False" Width="400" Height="150" ShowGroupPanel="False" ScrollViewer.VerticalScrollBarVisibility="Auto">
<tk:RadGridView.Columns>
<tk:GridViewDataColumn Header="Matter Id" DataMemberBinding="{Binding MatterId}" Width="150*" SortingState="Ascending" />
<tk:GridViewDataColumn Header="Description" DataMemberBinding="{Binding MatterDescription}" Width="200*"/>
</tk:RadGridView.Columns>
</tk:RadGridView>
</ControlTemplate>
</tk:RadComboBoxItem.Template>
</tk:RadComboBoxItem>
</tk:RadComboBox.Items>
</tk:RadComboBox>

 

In the Viewmodel, the "MatterList" dataset is an observable collection which invokes "RaisePropertyChanged" event when updated.

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 16 Aug 2016, 08:17 AM
Hello Glenn,

From the provided snippet it seems you are trying to place RadGridView inside RadComboBox. For such scenarios we suggest checking our SDK example demonstrating that approach - we haven't notice any issues with the example and the functionality of RadComboBox:
https://github.com/telerik/xaml-sdk/tree/master/ComboBox/DropDownWithHeaders

Also, please notice that when IsFiltetingEnabled is set to True that due to some limitations of the ComboBox ( and more specifically ItemsControl which it inherits from)  auto-completion and filtering cannot be achieved at the same time. Because of that in order the filtering functionality to work as expected the IsTextSearchEnabled should be set to False.

We hope this will help you.

Regards,
Nasko
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Glenn
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or