Sorting and filtering problem with GridViewComboBoxColumn

19 posts, 0 answers
  1. brandon
    brandon avatar
    16 posts
    Member since:
    Nov 2009

    Posted 07 Dec 2009 Link to this post

    I have this as my column declaration:
     <telerikGridView:GridViewComboBoxColumn Header="Zone"  DataMemberBinding="{Binding ZoneId}" UniqueName="Zone" SelectedValueMemberPath="Id" DisplayMemberPath="Description" /> 


    And I am binding my drop down in code behind:
    ((GridViewComboBoxColumn)grid.Columns["Zone"]).ItemsSource = e.Result;  

    The column works fine for editing and displaying, but when I sort it, it sorts on the ZoneId, not the Description.  When I filter, it gives me a list of Id's, not Descriptions.
  2. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 08 Dec 2009 Link to this post

    Hi Brandon,

    You can use the SortMemberPath property on the column to specify the property (Description in your case) that will be used for sorting.


    Regards,
    Stefan Dobrev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. brandon
    brandon avatar
    16 posts
    Member since:
    Nov 2009

    Posted 08 Dec 2009 Link to this post

    That worked great for sorting.  Thank you.  How about the filter choices?
  5. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 11 Dec 2009 Link to this post

    Hi Brandon,

    For the filtering we are looking into ways to provide this by default when you have a combo box column. Till then the only thing I can think out you can implement is a custom filtering control that filters by the other property.

    Hope this helps,
    Stefan Dobrev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Josh
    Josh avatar
    29 posts
    Member since:
    Feb 2009

    Posted 05 May 2010 Link to this post

    Any update on whether this problem for filtering on combobox columns has been resolved?

    Thanks
  7. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 10 May 2010 Link to this post

    Hello Josh,

    So far the only way to filter a combo box column is by using a custom filtering control . Let me know if you decide to go that way and need an assistance or a sample.

    Regards,
    Pavel Pavlov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Jeejee Unwalla
    Jeejee Unwalla avatar
    4 posts
    Member since:
    Apr 2010

    Posted 28 May 2010 Link to this post

    Hi.

    I too am having a problem.

    This effectively renders the default GridViewComboBoxColumn filtering useless.

    Please could you provide a sample of how to work around this

    Thanks
    Jeejee
  9. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 28 May 2010 Link to this post

    Hello Jeejee Unwalla,

    Please have a look at this blog post. I believe it contains the sample requested.

    Kind regards,
    Pavel Pavlov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Jeejee Unwalla
    Jeejee Unwalla avatar
    4 posts
    Member since:
    Apr 2010

    Posted 28 May 2010 Link to this post

    Hi Pavel,

    Thanks for the prompt reply however that does not really help me.

    I was looking for the implementation of the default functionality.

    Obviously, I need to make the application consistent and to do that I would have to replicate ALL your current functionality for filtering other column types (which I have to say is excellent). Surely that is not your intention because it would be a completely redundant excersize all developers would have to do.

    Is this something that will get fixed in future versions? Will there be something like a FilterMemberPath element on the GridViewComboBoxColumn?

    FYI, I am using Silverlight 4.0 and the latest version of the builds.

    Thanks & Regards,
    Jeejee
  11. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 28 May 2010 Link to this post

    Hello Jeejee Unwalla,

    Since the filtering logic is executed in the data layer  and the ComboBox column performs the lookup logic in th UI layer( translating selected  value to display value ) the task is more complex than it seems.
    Therefore unfortunately  I can not commit we are going to add such features for our very next releases.

    Kind regards,
    Pavel Pavlov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  12. Calin Calin
    Calin Calin avatar
    59 posts
    Member since:
    Mar 2010

    Posted 18 Jun 2010 Link to this post

    Hi Pavel,

    Why not add a FilterMemberPath same as you have SortMemberPath ?

    Regards,
  13. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 18 Jun 2010 Link to this post

    Hello,

     Generally adding FilterMemberPath will not enable filtering on the lookup value however you can build your own filter control to achieve desired logic.

    Kind regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. v-govinr@microsoft.com
    v-govinr@microsoft.com avatar
    18 posts
    Member since:
    Jun 2010

    Posted 02 Jul 2010 Link to this post

    Hi,
    I am facing similar problem,is it fixed or we ned to implement custom filtering.
    Can you please guide on the same for silverlight.The blog mentioned above is realted to WPF.
  15. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 02 Jul 2010 Link to this post

    Hi v-govinr@microsoft.com,

    For the time being , creating a custom filtering control is the only way to go in such case.
    In the previous posts in these threads there are some useful links on how to create one.

    All the best,
    Pavel Pavlov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  16. George Fryberger
    George Fryberger avatar
    6 posts
    Member since:
    May 2009

    Posted 27 May 2011 Link to this post

    Any news on when this might be included in a release.  It has been almost a year and half since the original post was made and I am personally disappointed that it isn't there.  You usually do a wonderful job giving us the out of the box functionality that we would want to have.
  17. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 01 Jun 2011 Link to this post

    Hi Kevin ,

    This problem is  a not a small  challenge as the lookup logic happens in the UI layer  ( by the combobox itself ) .At the other side -the data layer is responsible for operations such as sorting grouping and  and filtering. We are putting strong efforts in order to solve that discrepancy. However some major refactoring is required and still we are aiming to not introduce breaking changes in the API .
    Having this it is a bit hard for me to state a certain date when this wil be provided.

    We are doing our best to solve the issue. If you take the latest internal build , you may notice there are some improvements already  - the distinct values in the filter are now translated to Display Member .

    Regards,
    Pavel Pavlov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  18. Pankaj
    Pankaj avatar
    15 posts
    Member since:
    May 2011

    Posted 18 Nov 2011 Link to this post

    Hi Stefan,

    SortMemberPath has to be the property from the itemsource of gridview and not the itemsource of comboboxcolumn. This i read on some telerik blog froom some telerik guy only. Let's take the above example: if i set the sortmember path as decription then it doesn't sort the records but if i set sortmemberpath to zoneid which is the property in the itemssource of radgridview then sorting works but it works on the id and not the description. Please suggest how can I sort on the description?

    Please refer the following link.
    http://www.telerik.com/community/forums/wpf/gridview/sort-filter-on-a-column-of-type-radgridviewcombobox.aspx
  19. Renish
    Renish avatar
    1 posts
    Member since:
    Apr 2016

    Posted 25 Apr Link to this post

    Hi,

    I am facing filtering problem, in my filter it always shows Ids. I have tried to use the custom filter using this link http://www.telerik.com/blogs/filtering-gridviewcomboboxcolumn-in-radgridview-for-wpf  but not able still facing issues. Is there any other way to achieve this.

    Using Silverlight Q2 2013 v2013.2.724.1050 version. Please help

     

     

     

  20. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 26 Apr Link to this post

    Hello Renish,

    With the latest version of Telerik UI for Silverlight, GridViewComboBoxColumn has native filtering support when the source of the column is set through its ItemsSource property. However, you can always use the following approach - you can expose a new read-only property that will contain the value to be displayed in the GridViewComboBoxColumn and set it as FilterMemberPath for the ComboBoxColumn. The FilterMemberPath property of the column allows you to bind to one property and filter by another property of the business object class. I would suggest you to check this example where you can observe the use of FilterMemberPath and ComboboxColumn in action.

    Regards,
    Yoan
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
DevCraft banner