GridViewComboBoxColumn filtering

6 posts, 0 answers
  1. ueli
    ueli avatar
    3 posts
    Member since:
    Jan 2016

    Posted 04 Mar Link to this post

    I'm working with the Trialversion and I'm trying to find out if the GridViewComboBoxColumn allows filtering based on the value of the previous column.

    Datasource of GridViewComboBoxColumn :

    USA      Colorado

    USA      Iowa
    Canada Quebec
    Canada Ontario

    Datagrid:

    Country     ¦      State

    --------------¦---------------------------------------------------------------

    USA          ¦     Combobox which shows only the states of US (Colorado, Iowa)

     

    Have somebody an example?

    Thanks a lot for your help

  2. Dimitar
    Admin
    Dimitar avatar
    1409 posts

    Posted 07 Mar Link to this post

    Hello Ueli,

    Thank you for writing.

    An example for this is available on the following page: Cascading ComboBoxes in RadGridView. | Telerik UI for WinForms Knowledge Base

    If you have any other questions, please do not hesitate to contact us.

    Regards,
    Dimitar
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. ueli
    ueli avatar
    3 posts
    Member since:
    Jan 2016

    Posted 09 Mar in reply to Dimitar Link to this post

    Thanks for your reply. the example works fine. Is it possible to filter the same way by using a dataset insead of a BindingList?

    Kind regards

    Ueli

  5. Dimitar
    Admin
    Dimitar avatar
    1409 posts

    Posted 10 Mar Link to this post

    Hello Ueli,

    Thank you for writing back.

    Yes, you can, the main thing here is that you need to check the cell values and change the data source before showing the drop down (see step 4 in the article). It does not matter what data source is used for the grid or the drop down list. 

    Let me know if I can assist you further.
     
    Regards,
    Dimitar
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. ueli
    ueli avatar
    3 posts
    Member since:
    Jan 2016

    Posted 10 Mar in reply to Dimitar Link to this post

    Hi Dimitar

    Thank's for your response. What you sad works but it doesn't seem like a dynamic solution. We don't want to change code if new food types will be added (e.g. milk products). Are there any other solutions?

    Kind regards

    Ueli

  7. Dimitar
    Admin
    Dimitar avatar
    1409 posts

    Posted 11 Mar Link to this post

    Hello Ueli,

    Thank you for writing back.

    There are no other solutions for this. However, I cannot see why you cannot use this solution. All you need to do is to get the value from the first drop-down list and then set the data source according to it. Perhaps you can create a method that returns the products according to the product type. Then you can use it instead of the if statement in the CellEditorInitialized event.

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    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
UI for WinForms is Visual Studio 2017 Ready