dropdown defaultItem template

1 Answer 100 Views
DropDownList
Hernando
Top achievements
Rank 1
Iron
Iron
Hernando asked on 21 Apr 2023, 02:41 PM

how can edit the dropdown defaultitem cell , I want to change the background colour and font size . thanks 

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Martin Bechev
Telerik team
answered on 26 Apr 2023, 07:51 AM

Hi Hernando,

I noticed that we already have a private discussion about this requirement, but I will share the response here for the auditory:

To customize the options inside the DropDownList, custom CSS needs to be used.

Since the options are rendered inside a Popup container which is rendered at the root level of the application, you can create a custom CSS selector that targets the desired label like:

https://stackblitz.com/edit/angular-5vogn8

or use the built-in popupSettings of the DropDownList to increase the CSS specificity (avoid styling other Popups in the same way):

https://stackblitz.com/edit/angular-5vogn8-f5f1ob

In case the styling of other elements of the DropDownList must be customized, inspect the components and create the necessary CSS selectors. As the popup closes when the component is blurred, please check the following article on how to inspect the component's popup:

https://www.telerik.com/kendo-angular-ui/components/knowledge-base/dropdowns-popup-inspection/

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DropDownList
Asked by
Hernando
Top achievements
Rank 1
Iron
Iron
Answers by
Martin Bechev
Telerik team
Share this question
or