Custom DropDownList

Custom DropDownList

Released 7 years ago , Last update 6 years ago

A customizable DropDownList control

The default DropDownList control for ASP.NET is not very flexible - sometimes we need to fit a dropdown control in tight space or consider other layout restrictions that don't mix well with the default dropdown control.

This DropDownList control is similar to the default but without the arrow (to make it slimmer) and comes with easily customizable CSS.

You can change properties such as:

  • Width
  • Height
  • Row height
  • CSS styles through the includes CSS file
  • Maximum rows shown

And more.

Included in the package is a test page where the functionality of the custom DropDownList is demonstrated.

3.0
  • 5 0
  • 4 0
  • 3 1
  • 2 0
  • 1 0
1 Reviews Read Reviews

Pricing

14 day 14-day money-back guarantee

$14.99

Personal License

  • Perpetual license

  • 1 site, unlimited servers

  • No distribution (hosted use only)

  • Commercial use

1 license From » $14.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
  • RH Ray Howell License holderPersonal License
    Purchased on Oct 22, 2011
    6 years ago
    I did convert this to Net.VB but can't get the convert to dll via command line in vs2010 to create a dll otherwise I would have let you have the vb version. My main question with this remains: how programmatically can I get the users selection? Datasource wise I grab values from a database and using the sql reader and the 'with' statement travel through the data then using your item.add statement, each row is add, so that is ok. It is getting the users value which is the problem. Can it be done? Thanks
    • BP Blagovest Petrov Publisher 6 years ago
      In the test page you can see: List list = new List(); list.Add(new CustomerDropdownList.ValueName("0","-")); for(int i=0;i<=31;i++) { list.Add(new CustomDropDownList(i.ToString(), i.ToString())); } CustomDropDownList1.KeyValues = list; In this way you create a list which can be use the source for the customdropdown list. You add items to a list and those items contain key and value for the dropdown. Then you bind it to the CustomDropDownList added in your page.
    • RH Ray Howell 6 years ago
      Hi, Thanks what you have is explained is sort of what I am doing except I am pulling data in from a database - see below for the code (I've omitted the connection string) My difficulty is I am not 'seeing' how to grab the value the user selects. Somehow I need get the value or text which populates the 'textbox' I cant seem to add any useful code function in asp.net code page, neither can I add a client onclick, that is what I need help with thanks. I can of course use document.getElementById("") etc, but I would like something where I don't have to 'pre know' the id? and I would like to grab the value via Asp.code nut without runat that isn't going to be easily possible. I could possibly run a javasc function to grab the value from the standard textbox and to place it into a hidden asp.control? Here for clarity is my datasource code: Dim list As New List(Of CustomDropDownList.ValueName) Dim sql = "SELECT id, model as NList, pos FROM model ORDER BY pos, Model" Dim conn As New SqlConnection(connstring) Dim objDR As SqlDataReader Using Cmd As New SqlCommand(sql, conn) conn.Open() objDR = Cmd.ExecuteReader() While objDR.Read() list.Add(New CustomDropDownList.ValueName(objDR("id"), objDR("NList"))) End While End Using CustomDropDownList1.KeyValues = list
    • BP Blagovest Petrov Publisher 6 years ago
      HI, Then you can just do CustomDropDownList1.SelectedValue or CustomDropDownList1.SelectedText. Depends on what you need.
    • RH Ray Howell 6 years ago
      Hi thanks - was just on the point of saying this dunderhead had realised that when you sent this reply. Thanks. Also, if anyone is interested and haven't worked it out for them selves a stripy background can be applied thus: Set the panel background colour - I used white - then add these 2 CSS statements: .ctrl_Panel div:last-child { border-bottom: 1px solid #DDD; } .ctrl_Panel div:nth-child(even) { background: #D7E8F0; color:black; } Use with an update panel. There seemed to be a problem with use via an Asp update panel. It looked as if the javascript code used within the control doesn't reattach after a partial page reload so the drop part didn't 'open'. Without a panel then it functions fine. In my experiment I was using a textbox to apply a filter to the original sql used to populate the control, but with the update panel this ceased to function, and like I said the control failed to dropdown. Adding an AscPostBack triggers etc didn't solve it - BUT the postback trigger did so we are up an cooking on gas. I still think this is actually a good control. Regards