I have a DropDownlist(DDL) which is populated by Database from Client Side.
I want to change font-family or Change CSS Class of particular items in DDL depending on some conditions (on DataValue Field basis of DDL).
I have tried following code:
protected void ddlAuthor1_OnDataBinding(object sender, EventArgs e)
{
foreach (ListItem item in ddlAuthor1.Items)
{
if (int.Parse(item.Value) == 1)
{
item.Attributes.Add("style", "font-family:AmrLipi;");
}
}
upBookEntryForm.Update();
}
But it didnot work for me. I tried this code in OnDataBound event also but no success.
Please Help me on this issue