Gallery filter function based on the drop-down value
Problem statement
If we use the data source directly to the gallery, we may face the delegation issues. To avoid that we can use a drop-down to filter a gallery.
![](https://sainacloud.com/wp-content/uploads/2023/12/rsw_1280-1-10-1024x575.webp)
Resolution
- We can add a drop-down and map a related entity to filter a gallery.
- For this i have added a drop-down control and mapped a course entity for it.
- To insert a drop-down control – go to the insert menu in the ribbon bar, and select input following by select the drop-down control or combo box control.
- After adding it to the screen, select the items property of the control and select the entity you want to use.
![](https://sainacloud.com/wp-content/uploads/2023/12/rsw_1280-2-9-1024x502.webp)
Write a Code as mention in the image.
![](https://sainacloud.com/wp-content/uploads/2023/12/rsw_1280-3-9-1024x501.webp)
Gallery before filter function,
![](https://sainacloud.com/wp-content/uploads/2023/12/rsw_1280-4-7-1024x501.webp)
Gallery after applying a Filter,
![](https://sainacloud.com/wp-content/uploads/2023/12/rsw_1280-5-6-1024x501.webp)
![](https://sainacloud.com/wp-content/uploads/2023/12/rsw_1280-3-5-1016x1024.webp)