Telerik Textbox [RadInput] Not Supporting AutoComplete Implementation Using Jquery

1.3k Views Asked by At

I want To Implement AutoComplete Functionality On Telerik TextBox [RadInput] Using Jquery And Web Service.When I enter Any Character, I receive relative Suggestion From Database. This All Works Fine If i Use Simple ASP Textbox. It doesn't Work With RadTextBox.

Any Idea Why This Happens ?

Please Don't Provide Me This Link Of RadComboBox http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx I only Want To Use RadTextBox.

Thanks In Advance..

Pratik Bhatt

1

There are 1 best solutions below

2
On

I've used this before with success -

http://www.dotnetcurry.com/ShowArticle.aspx?ID=515

I just modified the script slightly, as follows -

$(function() {
    $(".tb").autocomplete({
        source: function(request, response) {
            $.ajax({
                url: "EmployeeList.asmx/FetchEmailList",
                data: "{ 'mail': '" + request.term + "' }",
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataFilter: function(data) { return data; },
                success: function(data) {
                        response($.map(data.d, function(item) {
                            return {
                                Cost: item.Cost //***
                            }
                        }))
                    },
                select: function( event, ui ) {
        $find("<%= RadTextBox1.ClientID %>").set_value(ui.item.Cost); //***
            },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(textStatus);
                }
            });
        },
        minLength: 2
    });
});

I've marked the lines of interest with //* * *