set_text gives SyntaxError: illegal character

2 posts, 0 answers
  1. Larissa
    Larissa avatar
    19 posts
    Member since:
    Dec 2015

    Posted 16 Feb 2016 Link to this post

    I'm trying to populate a RadComboBox but I'm getting this error and I don't know why.

    My RadComboBox:

    <telerik:RadComboBox ID="regTypeComboBox" runat="server" Width="305" Skin="Telerik" OnClientLoad="OnClientLoadHandler" />

    My js:

    function OnClientLoadHandler(sender) {
        var combo;
        combo = sender;

        var serviceUrl = "myUrl";

        var paramData = {


            type: 'GET',
            url: serviceUrl,
            contentType: 'application/json; charset=utf-8',
            crossDomain: true,
            data: JSON.stringify(paramData),
            dataType: 'json',
            success: function (response) {
                var listData = response.listData;
                $.each(listData, function (index, element) {
                    var name, id;
                    name = element.NAME;
                    id = element.ID;
                    var comboItem = new Telerik.Web.UI.RadComboBoxItem();
                    comboItem.set_text(name); // --> SyntaxError: illegal character

                    //comboItem.set_text("name"); // --> also SyntaxError: illegal character

                    //comboItem.set_text(""); // --> also SyntaxError: illegal character

            error: function () {


    It is pretty simple, but I don't know why it gives this error.

    Any ideas? Thanks



  2. Ivan Danchev
    Ivan Danchev avatar
    1301 posts

    Posted 19 Feb 2016 Link to this post

    Hello Larissa,

    We tested your scenario, but were unable to reproduce the illegal character exception. I attached a sample project, which contains a RadComboBox bound with Web API, could you please try reproducing the error in it and post your modifications for further review?

    Ivan Danchev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top