Hello Sunithra,
Greetings from Syncfusion support.
To enable tick icon for selected item in a DropDownList, you need to use the iconCss field to add the icon to the popup list. Since the icon needs to be displayed for selected item. We need to customize the existing behavior for the selected item by overriding the default styles using cssClass property. The icon is added only to the active item in the list. Kindly refer to the following code snippet.
<style>
.e-active-tick .e-dropdownbase .e-list-item.e-active .e-list-icon {
font-family: 'e-icons';
color: rgba(0, 0, 0, .57);
font-size: 33px;
padding: 0px;
}
.e-active-tick .e-list-item.e-active {
text-indent: 0px;
}
.e-active-tick .e-list-item.e-active .tick:before {
content: '\e259'
}
.e-active-tick .e-dropdownbase .e-list-item.e-active {
background: #fff;
color: #333;
border-color: #fff;
}
.e-active-tick .e-dropdownbase .e-list-item.e-active.e-hover {
background-color: #f5f5f5;
border-color: #fff;
color: #333;
}
</style> |
<ejs-dropdownlist id='games' #sample1 [dataSource]='sportsData' [cssClass]='customClass' [fields]='localFields' [placeholder]='localWaterMark' [popupHeight]='height'></ejs-dropdownlist> |
public localFields: Object = { text: 'Game', value: 'Id', iconCss: 'Class' };
public customClass: string = 'e-active-tick'; |
We have attached the sample for your reference, please find the sample at the following location:
Let us know if you need any further assistance on this.
Regards,
Prince