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

GridViewComboBoxColumn filtering

5 Answers 214 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ueli
Top achievements
Rank 1
ueli asked on 04 Mar 2016, 05:03 PM

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

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 07 Mar 2016, 10:31 AM
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
0
ueli
Top achievements
Rank 1
answered on 09 Mar 2016, 03:02 PM

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

0
Dimitar
Telerik team
answered on 10 Mar 2016, 10:42 AM
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.
0
ueli
Top achievements
Rank 1
answered on 10 Mar 2016, 01:36 PM

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

0
Dimitar
Telerik team
answered on 11 Mar 2016, 11:28 AM
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.
Tags
GridView
Asked by
ueli
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
ueli
Top achievements
Rank 1
Share this question
or