2

コンボボックス機能を備えたAjaxツールキットを使用しています。表示されるアイテムは約40,000なので、フィルターを適用して、ユーザーがコンボボックスにアルファベットを入力し、対応するエントリのアルファベットが「a」で始まるようにします。コンボボックスに表示されます。

私はRadcomboboxを使用していません、それは最も単純なコンボボックスです。

<asp:ComboBox ID="AppComCombx" runat="server" 
                                CssClass="dropdownpersonal textfont" 
                                onselectedindexchanged="AppComCombx_SelectedIndexChanged" AutoPostBack="true"> 
</asp:ComboBox>
4

2 に答える 2

0

ScriptManager以下のスクリプトを使用してjsファイルの参照に追加し、コンボにSuggestまたはモードを使用しますNone

Sys.Application.add_load(function () {
    Sys.Extended.UI.ComboBox.prototype._ensureHighlightedIndex = function () {
        // highlight an index according to textbox value
        var textBoxValue = this.get_textBoxControl().value;

        // first, check the current highlighted index
        if (this._highlightedIndex != null && this._highlightedIndex >= 0
            && this._isExactMatch(this._optionListItems[this._highlightedIndex].text, textBoxValue)) {
            return;
        }

        // need to find the correct index
        var firstMatch = -1;
        var ensured = false;
        var children = this.get_optionListControl().childNodes;

        for (var i = 0; i < this._optionListItems.length; i++) {
            var itemText = this._optionListItems[i].text;
            children[i].style.display = this._isPrefixMatch(itemText, textBoxValue) ? "list-item" : "none";

            if (!ensured && this._isExactMatch(itemText, textBoxValue)) {
                this._highlightListItem(i, true);
                ensured = true;
            }
            // if in DropDownList mode, save first match.
            else if (!ensured && firstMatch < 0 && this._highlightSuggestedItem) {
                if (this._isPrefixMatch(itemText, textBoxValue)) {
                    firstMatch = i;
                }
            }
        }

        if (!ensured) {
            this._highlightListItem(firstMatch, true);
        }
    };
});

この場合、ComboBox がページ上のすべてのアイテムをレンダリングするため、AutoCompleteExtender を選択することをお勧めします。

于 2012-10-01T10:50:11.437 に答える
0

これを試して :AutoCompleteMode = "SuggestAppend"

このような

<ajaxToolkit:ComboBox ID="ComboBox1" runat="server"
     AutoPostBack="False"
     DropDownStyle="DropDownList"
     AutoCompleteMode="SuggestAppend"
     CaseSensitive="False"
     CssClass=""
     ItemInsertLocation="Append" /> 

詳細はこちら

于 2012-10-01T08:50:45.897 に答える