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

Combo box binding from multiple instances of partial view

3 Answers 53 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
todd.whitehead
Top achievements
Rank 1
todd.whitehead asked on 14 Jun 2012, 04:59 AM
I have partial view that displays basic address fields that is included multiple times on the same host page: once for billing and once for shipping address.  This works as expected for the first instance on the page but bindinf event fails to fire for the second instance.

I suspect its because the client events have the same name but I'm not sure how to avoid that. I've been through all the samples and doco but havent found anything helpful. Help.
@(Html.Telerik().ComboBox()
    .Name("AjaxComboBox")
    .AutoFill(true)
    .HtmlAttributes(new { id = "AjaxComboBox_wrapper" , style = "width: 250px; float: left;" }).DropDownHtmlAttributes(new { style = "height: 200px" })
    .DataBinding(binding => binding.Ajax()
    .Select("_FilteringAjax", "Customer")
    .Delay(400)
    .Cache(true))
    .Filterable(filtering =>
                {
                    filtering.FilterMode(AutoCompleteFilterMode.Contains);
                    filtering.MinimumChars(3);                         
                })                     
    .HighlightFirstMatch(false)
    .ClientEvents(events => events
               .OnDataBinding("onComboBoxDataBinding")
               .OnChange("onComboBoxChange"))
          )
          <span class="field-validation-error"> *</span>
            @Html.ValidationMessageFor(model => model.ZipPostalCode)
            </td>
        </tr>
    }

 

function onComboBoxDataBinding(e) {
alert("binding");
e.data = $.extend({}, e.data, { filterMode: 1 });
}

3 Answers, 1 is accepted

Sort by
0
tbellinger
Top achievements
Rank 1
answered on 17 Jul 2012, 05:05 PM
+1 

I have the exact same issue.  I am adding a partial view containg a radcombobox several times to a page through a PartialViewResult.  The first instance of each item appears and works fine, but each subsequent one fails.  I suspect it is also the name/id + event wireup that is only happening to the first instance of each control on the page.

Any solutions?
0
todd.whitehead
Top achievements
Rank 1
answered on 17 Jul 2012, 11:46 PM
No response so far. I've lodged a support ticket to see it can be resolved that way.
0
tbellinger
Top achievements
Rank 1
answered on 24 Jul 2012, 01:52 PM
I ended up just using traditional dropdownlists, even after trying asynchronous binding failed.  I would still prefer to use the combobox though so it matches the look and feel of the rest of my application. It's really disappointing.
Tags
ComboBox
Asked by
todd.whitehead
Top achievements
Rank 1
Answers by
tbellinger
Top achievements
Rank 1
todd.whitehead
Top achievements
Rank 1
Share this question
or