Combobox滚动不正确

时间:2011-04-26 04:15:04

标签: javascript asp.net ajax telerik radcombobox

我正在使用RadCombobox Ajax控件,我有2个组合框,第二个按照第一个组合的方式在OnClientDropDownOpening事件上按语法填写 选择的项目,它工作正常,但有时第二个组合下拉列表变得非常小并滚动,这是我的代码:

Markup:
  <telerik:RadComboBox ID="cmbDescription"  Filter="StartsWith" AllowCustomText="true" 
     MaxLength="256" Style="margin-right: 1px"
     runat="server" OnClientSelectedIndexChanged="cmbDescription_onClinetSelectedIndexChanged" OnClientDropDownOpening="cmbDescription_OnClientDropDownOpening"  >


javascript:
    function cmbDescription_OnClientDropDownOpening(sender, args) {
        var tempSLRef = grdVoucherItems.get_tempEntity().SLRef;
        if (currentSLRef !== tempSLRef) {
           currentSLRef = tempSLRef;
           PageMethods.FetchAllSLStandardDescBySLID(currentSLRef, AjaxFetchAllSLStandardDescSucceeded, OnPageMethodFailed, null);
        }
    }
    function AjaxFetchAllSLStandardDescSucceeded(result, context) {
        lstSlStandardDescs = result;
        cmbDescription.get_items().clear();
        for (var i = 0; i < lstSlStandardDescs.length; i++) {
            var comboItem = new Telerik.Web.UI.RadComboBoxItem();
            comboItem.set_text(lstSlStandardDescs[i].Item1);
            comboItem.set_value(lstSlStandardDescs[i].Item3);
            cmbDescription.trackChanges();
            cmbDescription.get_items().add(comboItem);
            cmbDescription.commitChanges();

        }

0 个答案:

没有答案