does anyone know how can I style a asp dropdownlist? The arrow of the dropdown is difficult to change, this is how it looks like initially:
Does anyone has any solution to fix or style this asp dropdownlist?
This is my code: (I could not change this into select dropdownlist because my dropdownlist options are being populated dynamically based on selection from a listbox)
Asp file
<asp:DropDownList ID="NewDropDownList" runat="server" Width="136px"
OnSelectedIndexChanged="jobRun_SelectedIndexChanged" AutoPostBack="True" >
</asp:DropDownList>
Cs file
public void BindNewDropDownList()
{
//Lost to hold the values
List<DateTime> listCopy = new List<DateTime>();
DateTime dt;
string values = String.Join(", ", JOBRUN_CBL.Items.Cast<ListItem>().Where(i => i.Selected).Select(i => i.Text));
if (values.Contains("Select All"))
{
//Loop through each items in listbox and then add it to list
foreach (ListItem li in ListBox1.Items)
{
if (DateTime.TryParse(li.Text, out dt))
{
listCopy.Add(dt);
}
}
}
else
{
//Loop through each items in listbox and then add it to list
foreach (ListItem li in ListBox1.Items)
{
//check if item is selected
if (li.Selected == true)
{
//add items to list
listCopy.Add(DateTime.Parse(li.Text));
}
}
}
//compare and sort so that the latest date comes on top
listCopy.Sort((x, y) => y.CompareTo(x));
//clear the items in dropdownlist
NewDropDownList.Items.Clear();
//set the datasource to dropdownlist
NewDropDownList.DataSource = listCopy;
//set the dateformatstring in dropdownlist
NewDropDownList.DataTextFormatString = "{0:dd-MMM-yyyy}";
//Bind the dropdownlist
NewDropDownList.DataBind();
}
Please help me on this, been finding solution for this for quite sometime but still cannot find a way to decorate it.
Thanks.