Edit this page

Filter the Items in GridViewComboBoxColumn

Since, the editor of GridViewComboBoxColumn is RadComboBox, you can benefit from its advanced filtering mechanism.

PROBLEM

The default ItemsPanel of RadComboBox inside GridViewComboBoxColumn is VirtualizingStackPanel. This means that RadComboBox is virtualized and only the items in the visible area are loaded. So the filtering will work for these items only.

SOLUTION

To resolve the problem you just have to change RadComboBox's ItemsPanel with StackPanel:

<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding CountryId}"
                    UniqueName="Country"
                    SelectedValueMemberPath="Id"
                    DisplayMemberPath="Name" 
                    IsComboBoxEditable="True"
                    EditTriggers="CellClick">
    <telerik:GridViewComboBoxColumn.EditorStyle>
        <Style TargetType="telerik:RadComboBox">
            <Setter Property="IsFilteringEnabled" Value="True"/>
            <Setter Property="StaysOpenOnEdit" Value="True"/>
        <Setter Property="OpenDropDownOnFocus" Value="True"/>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <StackPanel/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:GridViewComboBoxColumn.EditorStyle>
</telerik:GridViewComboBoxColumn>

See Also

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy