GridViewComboBoxColumn not filtering

9 posts, 0 answers
  1. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 30 Mar 2015 Link to this post

    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?

  2. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 31 Mar 2015 Link to this post

    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>
  3. Nick
    Admin
    Nick avatar
    593 posts

    Posted 31 Mar 2015 Link to this post

    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.

     
  4. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 31 Mar 2015 in reply to Nick Link to this post

    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.
  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 01 Apr 2015 Link to this post

    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.

     
  6. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 01 Apr 2015 Link to this post

    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. 




  7. Nick
    Admin
    Nick avatar
    593 posts

    Posted 02 Apr 2015 Link to this post

    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.

     
  8. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 02 Apr 2015 in reply to Nick Link to this post

    Thank you! That was the problem right there.
  9. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 02 Apr 2015 in reply to Nick Link to this post

    Thank you!
Back to Top