RadGridView in Item Template

2 posts, 0 answers
  1. Glenn
    Glenn avatar
    2 posts
    Member since:
    Jun 2016

    Posted 15 Aug Link to this post

    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.

  2. Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 16 Aug Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top