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

Problem in Add new button of Grid

3 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Naresh
Top achievements
Rank 2
Naresh asked on 15 Apr 2011, 07:50 AM
Hi,

i have used the radgrid to display the documents.
i'll get the Script error when i click the "add new button"
Help me to resolve this problem.

My Code is:
<form id="form1" runat="server">
   <telerik:RadScriptManager runat="server" ID="rsmQuoteDocument">
   </telerik:RadScriptManager>
   <telerik:RadWindowManager ID="rwmQuoteDoc" runat="server">
   </telerik:RadWindowManager>
   <input id="DcoId" type="hidden" runat="server" />
   <asp:Button ID="btnDOC" runat="server" OnClick="btnDOC_Click" Style="display: none" />
   <telerik:RadAjaxManager runat="server" ID="ramQuotesDoc">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID ="rgQouteDocuments">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="rapDocument" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>
   <telerik:RadAjaxPanel ID="rapDocument" runat="server">
       <telerik:RadGrid runat="server" ID="rgQouteDocuments" Skin="Office2007"
           Width="99.5%" ondeletecommand="rgQouteDocuments_OnDeleteCommand"
           oninsertcommand="rgQouteDocuments_OnInsertCommand"
           onitemdatabound="rgQouteDocuments_OnItemDataBound"
           onneeddatasource="rgQouteDocuments_NeedDataSource"
           onupdatecommand="rgQouteDocuments_OnUpdateCommand" AllowAutomaticInserts="false" AllowAutomaticUpdates="true" AutoGenerateColumns="false">
           <ClientSettings>
               <Selecting EnableDragToSelectRows="false" AllowRowSelect="true" />
           </ClientSettings>
           <ItemStyle CssClass="RadGridItem" />
           <AlternatingItemStyle CssClass="RadGridItem" />
           <PagerStyle Mode="NextPrevAndNumeric" PageSizeLabelText="Pages" ShowPagerText="false" />
           <MasterTableView DataKeyNames="QuoteDocumentID,QuoteId" CommandItemDisplay="Top"
               EditMode="EditForms">
               <NoRecordsTemplate>
                   <center>
                       <asp:Label ID="lblnoRecords" runat="server" CssClass="label" Text="No records found" />
                   </center>
               </NoRecordsTemplate>
               <Columns>
                   <telerik:GridBoundColumn UniqueName="QuoteDocumentID" HeaderText="DocumentID" DataField="QuoteDocumentID"
                       Visible="false" ReadOnly="true">
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="QuoteId" HeaderText="Quote ID" DataField="QuoteId"
                       Visible="false" ReadOnly="true">
                   </telerik:GridBoundColumn>
                   <telerik:GridButtonColumn UniqueName="ViewAppraisal" ButtonType="ImageButton" ImageUrl="~/Images/view-inventory.png"
                       Text="DownLoad" HeaderStyle-Width="110px" Visible="false">
                       <ItemStyle HorizontalAlign="Center" />
                   </telerik:GridButtonColumn>
                   <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="../Images/edit.png"
                       HeaderStyle-Width="30px">
                   </telerik:GridEditCommandColumn>
                   <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../Images/delete.png"
                       CommandName="delete" ItemStyle-HorizontalAlign="Center" ConfirmDialogType="RadWindow"
                       ConfirmDialogHeight="25px" ConfirmDialogWidth="410px" ConfirmTitle="Delete Document"
                       ConfirmText="Are you sure you want to delete this Inventory Documents?" HeaderStyle-Width="30px"
                       UniqueName="30px">
                   </telerik:GridButtonColumn>
                   <telerik:GridTemplateColumn HeaderText="Document Comment" EditFormHeaderTextFormat="Comment"
                       UniqueName="Comment" DataField="DocumentComment">
                       <ItemTemplate>
                           <asp:Label ID="lblDocumentComment" runat="server" Text='<%# Eval("DocumentComment") as string %>' />
                       </ItemTemplate>
                       <EditItemTemplate>
                           <telerik:RadTextBox ID="txbDescription" Width="250px" runat="server" TextMode="MultiLine"
                               Text='<%# Eval("DocumentComment") %>' Height="150px" />
                       </EditItemTemplate>
                       <ItemStyle VerticalAlign="Top" />
                   </telerik:GridTemplateColumn>
                   <telerik:GridDateTimeColumn DataField="DateUploaded" DataFormatString="{0:dd/MM/yyyy}"
                       HeaderText="Upload Date" EditFormHeaderTextFormat="Upload Date" ReadOnly="True">
                   </telerik:GridDateTimeColumn>
                   <telerik:GridBoundColumn UniqueName="UserId" HeaderText="Uploaded By" DataField="UserId"
                       ReadOnly="True" Visible="false" />
                   <telerik:GridBoundColumn UniqueName="UploadedBy" HeaderText="Uploaded By" DataField="UploadedBy"
                       EditFormHeaderTextFormat="UploadedBy" ReadOnly="True" ItemStyle-CssClass="mousepointer" />
                   <telerik:GridTemplateColumn HeaderText="Document" EditFormHeaderTextFormat="Upload Files"
                       UniqueName="Document" DataField="DocumentComment" Visible="false">
                       <ItemTemplate>
                           <asp:LinkButton ID="lbtnDocument" runat="server" Text='<%#Eval("DocumentPath") %>'></asp:LinkButton>
                       </ItemTemplate>
                       <EditItemTemplate>
                           <br />
                           <telerik:RadAsyncUpload HttpHandlerUrl="~/CustomHandler.ashx" ID="ruDocument" runat="server"
                               AllowedFileExtensions=".doc,.docx,.xlsx,.pdf,.dox,.rtf,.txt">
                           </telerik:RadAsyncUpload>
                           (Use format .doc,.docx,.xlsx,.pdf,.dox,.rtf,.txt)
                       </EditItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridButtonColumn HeaderText="Documents" ButtonType="LinkButton" UniqueName="Documents"
                       DataTextField="FileName" />
                   <telerik:GridBoundColumn UniqueName="DocumentName" DataField="DocumentPath" Visible="false"
                       ReadOnly="true" />
               </Columns>
               <CommandItemTemplate>
                   <table border="0" style="width: 100%;">
                       <tbody>
                           <tr>
                               <td align="left">
                                   <asp:LinkButton ID="AddNewRecordButton" runat="server" CommandName="InitInsert">
                                               <img style="border:0px" alt="Add New" src="../Images/add-icon.png" /> Add new document
                                   </asp:LinkButton>
                               </td>
                           </tr>
                       </tbody>
                   </table>
               </CommandItemTemplate>
               <EditFormSettings>
                   <EditColumn ButtonType="ImageButton" />
               </EditFormSettings>
           </MasterTableView>
       </telerik:RadGrid>
   </telerik:RadAjaxPanel>




3 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 19 Apr 2011, 01:29 PM
Hello Nagarajan,

As a starting point I suggest that you examine the following blog post:
Web Resources demystified: Part 3 (Troubleshooting)

Let us know whether this helps.

Greetings,
Pavlina
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.

0
Naresh
Top achievements
Rank 2
answered on 20 Apr 2011, 03:51 PM
Hi,

It's not working.. i'm using 2010.2.713.35 version.
Please give me a solution ASAP.............

Thanks
0
Pavlina
Telerik team
answered on 22 Apr 2011, 10:56 AM
Hi Nagarajan,

The exception you receive is rather generic and you will probably agree with me that it would be hard to determine the exact source of it based on the details provided. Can you isolate a simple working version of your project, exhibiting it, and send it enclosed to a regular support ticket? Thus I will research the matter further and will do everything possible to provide an accurate fix.

You may also examine the RadControls troubleshooting tips from this help article and utilize them to gather more info about the nature of the problem.

Greetings,
Pavlina
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
Grid
Asked by
Naresh
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Naresh
Top achievements
Rank 2
Share this question
or