Telerik ASP.NET Dropdownlist - Style each item in the dropdown separately

The task today is to style each item in a Telerik RadDropdownlist separately, like this:

Code below.

 

ddlVendorID.DataSource = SPs.fp_PM00200_SEL_forLookup("MASONS", app.Database).getTable
ddlVendorID.DataValueField = "vendorid"
ddlVendorID.DataTextField = "vendname"
ddlVendorID.DataBind()
 
For Each oRow As DropDownListItem In ddlVendorID.Items
    If oRow.Text.ToUpper.StartsWith("C") Then
        oRow.CssClass = "Error"
 
    End If
Next


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences