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:
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>