RadGrid/RadComboBox Error

6 posts, 0 answers
  1. Andrew Buxton
    Andrew Buxton avatar
    15 posts
    Member since:
    Apr 2010

    Posted 11 Aug 2010 Link to this post


    This is an interesting problem and I'm hoping you're able to help. I have a RadGrid in a page that is being displayed in a RadWindow. I am using the "InPlace" edit method on the grid which sits in the middle of the page and is updated using the RadAjaxManager. This all works fine. I should explain that I'm not using the datasource auto update functionality of the RadGrid, I'm fetching the values on the server-side and managing the update of the datasource myself. This all works as we would expect.

    I then came to the point where I needed to add a RadComboBox into one of the columns of the grid. So I removed the GridBoundColumn and replaced it with a GridTemplateColumn. I populate the RadComboBox from the code-behind using the ItemDataBound event handler. Whilst the RadComboBox appears to populate I now receive an error in the Microsoft Ajax client library, when I click to edit a row in the grid. This is fairly simple code but I'm unable to see where the issue is.

    What is interesting is this ... If I put back the GridBoundColumn and have both in the grid at the same time, I don't receive the client-side error at all, the RadComboBox populates and works as it should. As soon as I remove the GridBoundColumn, it stops working.

    I have included snippets from the code below. I would appreciate any help you can give, many thanks.

    The Error
    library: MicrosoftAjax.js
    line : var a=g?new h(g):new h
    output: Object Expected

    Code Behind
            public void DetailGrid_ItemDataBound(object sender, GridItemEventArgs e)
                if (e.Item is GridEditableItem && e.Item.IsInEditMode)
                    /* find the combo box that we're going to populate the detail types with */
                    RadComboBox ddlDetailTypes = (RadComboBox)e.Item.FindControl("ddlDetailTypes");

                    /* get the detail types to bind to the drop down list */
                    Dictionary<int, string> detailtypes = presenter.GetDetailTypes();

                    /* bind the drop down list */
                    ddlDetailTypes.DataSource = detailtypes;

                    /* select the value in the drop down list */
                    if (e.Item.DataItem != null)
                        ddlDetailTypes.SelectedValue = ((DetailModel)e.Item.DataItem).Type.ToString();

    Grid Bound Column
                            <telerik:GridDropDownColumn UniqueName="Type" DataField="Type" Visible="true" HeaderText="Type">
                                <ItemStyle Width="60" />

    Template Column (with RadComboBox)
                            <telerik:GridTemplateColumn UniqueName="Type" Visible="true" HeaderText="Type">
                                    <%# DataBinder.Eval(Container.DataItem, "TypeDescription") %>
                                    <telerik:RadComboBox DataTextField="Value" DataValueField="Key"  ID="ddlDetailTypes" runat="server" Skin="WebBlue" EnableEmbeddedScripts="false">
                                <ItemStyle Width="60" />
  2. Andrew Buxton
    Andrew Buxton avatar
    15 posts
    Member since:
    Apr 2010

    Posted 16 Aug 2010 Link to this post

    Any ideas on this one?

    For further info, if I leave the templated column in and just remove the RadComboBox declaration the grid renders fine. Just to be sure I commented out the server-side databind code and still got the JavaScript error, so it's definately something to do with adding the ComboBox into a templated column in the grid.

    Hope you can help with this,

  3. DevCraft R3 2016 release webinar banner
  4. Andrew Buxton
    Andrew Buxton avatar
    15 posts
    Member since:
    Apr 2010

    Posted 16 Aug 2010 Link to this post

    In addition to this it works perfectly with the standard asp:DropDownList control, so it must be an issue with the RadComboBox.

  5. Veli
    Veli avatar
    2002 posts

    Posted 16 Aug 2010 Link to this post

    Hello Andrew,

    You have disabled the embedded scripts of the combo. RadComboBox cannot work without its client scripts loaded, so if you do not load the scripts manually on the page, this is probably what's causing the JS error you are getting.

    All the best,
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  6. Andrew Buxton
    Andrew Buxton avatar
    15 posts
    Member since:
    Apr 2010

    Posted 16 Aug 2010 Link to this post

    Hi Veli,

    How silly is that, I couldn't see it for looking. It should be EnableEmbeddedSkins="false" not Scripts! A true Baldrick moment.

    Many thanks, I shall give that a try.


  7. Hansel Eduard
    Hansel Eduard avatar
    9 posts
    Member since:
    Apr 2016

    Posted 15 Jun Link to this post

    I have the same problem.
    I hope that anyone can help me


Back to Top
DevCraft R3 2016 release webinar banner