This is a migrated thread and some comments may be shown as answers.

Javascript Error when placed in RadGrid

1 Answer 55 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Justin McMillen
Top achievements
Rank 1
Justin McMillen asked on 26 Jan 2011, 04:29 PM
I get the following error when I place a RadListBox inside the edit template of a RadGrid and ajaxify them with the RadAjaxManagerProxy:

 Microsoft JScript runtime error: 'Telerik.Web.UI.RadListBox' is null or not an object

Here's a sample of code
<telerik:RadAjaxManagerProxy ID="RadAjaxProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="updatePanel">           
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="updatePanel"
                       LoadingPanelID="RadAjaxLoadingPanel2" /> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />          
            </UpdatedControls>
        </telerik:AjaxSetting>       
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Skin="Default" />
 
<asp:Panel ID="updatePanel" runat="server">
 
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="myDataSource" AllowAutomaticInserts="false"
     AllowAutomaticUpdates="false" AllowPaging="true" PageSize="50"
     AllowAutomaticDeletes="true" onitemcommand="RadGrid1_ItemCommand"
        oninsertcommand="RadGrid1_InsertCommand"
        onupdatecommand="RadGrid1_UpdateCommand">
        <MasterTableView AutoGenerateColumns="False" DataSourceID="myDataSource"
        HeaderStyle-HorizontalAlign="Center" CommandItemDisplay="Top">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" />
                <telerik:GridBoundColumn DataField="Field1" HeaderText="Field1"
                    ItemStyle-HorizontalAlign="Center" ReadOnly="true" >
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
             <FormTemplate>
              <div>
              <table>
              <tr>
              <td>
              <asp:TextBox ID="txtField1" runat="server" Text='<%# Bind("Field1") %>' />
              </td>
              <td valign="top">                                   
             <telerik:RadListBox ID="lstBox1" runat="server"
                              DataSourceID="listboxDataSource" 
                             DataTextField="TextField" DataValueField="ValueField" Height="200px" Width="400px"
              CheckBoxes="true" />                                
             </td>
              </tr>
              </table>                      
                <div class="commandLinksDiv">
                 <asp:LinkButton ID="lnkBtnUpdate" runat="server"
    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                 CssClass="commandLinks" ValidationGroup="vldEditForm">
                    <img src="../../Styles/images/Update.gif" alt="" />
                      <span><%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %></span>
                 </asp:LinkButton>
                 <asp:LinkButton ID="lnkBtnCancel" runat="server" CausesValidation="false"
                     CommandName="Cancel" CssClass="commandLinks" Text="Cancel">
                  <img src="../../Styles/images/Cancel.gif" alt="" />
                  <span>Cancel</span>
                  </asp:LinkButton>
                 </div>
                </div>
             </FormTemplate>
                <EditColumn ButtonType="ImageButton" CancelText="Cancel" InsertText="Insert"
                    UniqueName="EditCommandColumn1" UpdateText="Update">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Panel>

I get the error when I am debugging from Visual Studio and go into edit or insert mode.  Has anyone had this problem or know how to fix it?

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 31 Jan 2011, 10:50 AM
Hi,

We tried to reproduce the problem you described, but without much success. Please see our test project attached.
What is the difference in your case? Could you modify our project so that we can observe the error?

Kind regards,
Helen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ListBox
Asked by
Justin McMillen
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or