This is a migrated thread and some comments may be shown as answers.

Combobox Width Problem

1 Answer 200 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Artuğ
Top achievements
Rank 1
Artuğ asked on 28 Sep 2015, 10:19 AM
Hello,
 I want to change combobox width but I have problem with ​styling. I attached screen capture, I tried two way for set combo width but not working well. I using bootstrap in my project. How can I fix this problem?

Here is my code,

<div class="form-group">
            @Html.LabelFor(model => model.MusteriId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">              
                @(Html.Kendo().ComboBox()
          .Name("MusteriId")
          .Filter("contains")
          .Placeholder("Müşteri seçiniz...")
          .BindTo(ViewBag.MusteriId as SelectList)
          .Suggest(true)
          .HtmlAttributes(new { style = "width: 600px;" })
                )
                @Html.ValidationMessageFor(model => model.MusteriId, "", new { @class = "text-danger" })
            </div>
        </div><div class="form-group">
            @Html.LabelFor(model => model.AracId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">               
                @(Html.Kendo().ComboBox()
          .Name("AracId")
          .Filter("contains")
          .Placeholder("Araç seçiniz...")
          .BindTo(ViewBag.AracId as SelectList)
          .Suggest(true)
          .HtmlAttributes(new { style = "width: 85%;" })
                )
                @Html.ValidationMessageFor(model => model.AracId, "", new { @class = "text-danger" })
            </div>
        </div>

1 Answer, 1 is accepted

Sort by
0
Artuğ
Top achievements
Rank 1
answered on 28 Sep 2015, 02:48 PM

I fix it, in default asp.net mvc project template have site.css and its have 

input,
select,
textarea {
    max-width: 280px;
}

I delete it and fixed.​

Tags
ComboBox
Asked by
Artuğ
Top achievements
Rank 1
Answers by
Artuğ
Top achievements
Rank 1
Share this question
or