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

GridViewComboBoxColumn not filtering

8 Answers 400 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 30 Mar 2015, 02:35 PM
I am trying to get a gridviewcombobox to filter and it does not work as documented. 

The properties have different names than the combobox documentation and some properties are not the same as a combobox. 

I tried setting the edit panel style as suggested in the reply to another post, but when I do that the edit panel does not appear and the combo box does not function at all. I have the following code:

 <telerik:GridViewComboBoxColumn Header="Parent"
                                                IsComboBoxEditable="True"
                                                ItemsSource="{Binding AllFinishedProducts, Source={StaticResource finishedProduct}}"
                                                FilterMemberPath="PartNumber"
                                                DataMemberBinding="{Binding ParentId}"
                                                SelectedValueMemberPath="Id"                  
                                                DisplayMemberPath="PartNumber">

The current behavior is more like a search than a filter. How can I get a gridviewcomboboxcolumn to filter like a radcombobox?

8 Answers, 1 is accepted

Sort by
0
Eric
Top achievements
Rank 1
answered on 31 Mar 2015, 05:27 AM
I have tried following this tutorial: 

http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/filter-the-items-in-comboboxcolumn.html

Once I set the EditorStyle the editor shows up as if it's a blank, uneditable text box. Here is the code I used to test that: 

                <telerik:GridViewComboBoxColumn Header="Parent"
                                                ItemsSource="{Binding AllFinishedProducts, Source={StaticResource finishedProduct}}"
                                                DataMemberBinding="{Binding ParentId}"
                                                SelectedValueMemberPath="Id"                  
                                                DisplayMemberPath="PartNumber">
                    <telerik:GridViewComboBoxColumn.EditorStyle>
                        <Style TargetType="telerik:RadComboBox">
                            <Setter Property="Margin" Value="5"/>
                        </Style>
0
Nick
Telerik team
answered on 31 Mar 2015, 08:39 AM
Hello Eric,

I am not exactly sure what you are aiming to achieve with this. Are you trying to filter the GridView items, or is the goal to filter the items shown in the ComboBoxes across the cells? If this is not what your requirements are, would it be possible to share some more detailed info, and perhaps a simple example showing the desired outcome? 

Looking forward to hearing from you. 

Regards,
Nick
Telerik
 

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

 
0
Eric
Top achievements
Rank 1
answered on 31 Mar 2015, 01:21 PM
the goal is to make it easier to choose the right item in the combo box by typing what you want and having the combo box items filter as you type in that individual row.
0
Nick
Telerik team
answered on 01 Apr 2015, 11:40 AM
Hello Eric,

RadComboBox does not support filtering its items source. You can type the desired item and it will be selected runtime, but it wont remove the unmatched entries from the source.

This behavior is included in RadGridView's ComboBoxColumn. Once you enter the edit mode of the ComboBoxColumn, you can start typing and the relevant item in the ComboBox will be selected. 

I am attaching a project showing the behavior. 

Regards,
Nick
Telerik
 

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

 
0
Eric
Top achievements
Rank 1
answered on 01 Apr 2015, 04:49 PM
RadComboBox does support filtering its items source. There is a working sample in the telerik control demos and the documentation explains how to do it here: 

http://docs.telerik.com/devtools/wpf/controls/radcombobox/features/filtering.html

This example doesn't help because while there is a "isFiltering" property in the gridviewcomboboxcolumn class it doesn't make the combobox filter. 

in a gridviewcomboboxcolumn. Your documentation explains how to do it here: 

http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/filter-the-items-in-comboboxcolumn.html

This example doesn't help because even though it's specifically  written to do what I want to do, but if I so much as touch the EditorStyle the editor no longer functions at all for the comboboxcolumn. It would appear that this part of the documentation is out of date. 




0
Nick
Telerik team
answered on 02 Apr 2015, 06:09 AM
Hi Eric,

Indeed you are right. I am sorry for the misunderstanding. 
The style shown in the article should do the trick, however the problems you are experiencing hint that you are using NoXAML assemblies. If that is the case, you have to used the BasedOn property of the Style in order for it to not override the default styles. It should look something like:
<Style TargetType="telerik:RadComboBox" BasedOn={StaticResource RadComboBoxStyle}>
            <Setter Property="IsFilteringEnabled" Value="True"/>
            <Setter Property="StaysOpenOnEdit" Value="True"/>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <StackPanel/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>

Hope this helps. 

Regards,
Nick
Telerik
 

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

 
0
Eric
Top achievements
Rank 1
answered on 02 Apr 2015, 01:32 PM
Thank you! That was the problem right there.
0
Eric
Top achievements
Rank 1
answered on 02 Apr 2015, 01:33 PM
Thank you!
Tags
GridView
Asked by
Eric
Top achievements
Rank 1
Answers by
Eric
Top achievements
Rank 1
Nick
Telerik team
Share this question
or