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 ColoradoUSA 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
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
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
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.
Dimitar
Telerik
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
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.
Dimitar
Telerik