0

I'm attempting to add bootstrap style to an old application. One thing I have come across repeatedly is wanting to style an asp:DropDownList as a bootstrap dropdown.

I came across a SO post that said to use the form-control class. This actually works however it gives the control a width of 100% thanks to the form-control class which is taking priority over the grid's width.

I have been trying to figure out how to get it to prioritize the grid width, however I wonder that applying form-control is the wrong solution in the first place.

I would definitely prefer not to rewrite the asp:DropDownList using a button and ul as done in bootstrap examples b/c I would have to repeat this transformation a hundred times and it's simply not worth it.

1 Answer 1

0

Hum, you could add a width to the dropdownlist like this:

        <asp:DropDownList ID="DropDownList1" CssClass="form-control" runat="server"
            DataValueField="ID"
            DataTextField="HotelName"
            width="180px"
            ></asp:DropDownList>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.