<telerik:RadGrid ID="rgGrid" runat="server" AutoGenerateColumns="False" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" DataSourceID="ldsProfiles" GridLines="None" Skin="Office2007" BorderWidth="0px" OnItemCommand="rgGrid_ItemCommand" OnItemUpdated="rgGrid_ItemUpdated" OnItemInserted="rgGrid_ItemInserted" OnItemCreated="rgGrid_ItemCreated" > <MasterTableView DataKeyNames="ProposalAttachmentID" DataSourceID="ldsProfiles" EditMode="EditForms" CommandItemDisplay="Top" > <CommandItemStyle CssClass="gridHeader" /> <CommandItemTemplate> <div class="gridHeader"> Files </div> <div class="sectionHeaderButton" style="margin-left: 10px;"> <asp:LinkButton ID="rgProAddButton" runat="server" Text="(add)" CommandName="InitInsert" Visible='<%# !rgGrid.MasterTableView.IsItemInserted %>' /> </div> </CommandItemTemplate> <Columns> <telerik:GridBoundColumn DataField="UploadDate" DataType="System.DateTime" HeaderText="Date" ForceExtractValue="InEditMode" ReadOnly="true" SortExpression="UploadDate" UniqueName="UploadDate" DataFormatString="{0:MM/dd/yyyy}" ItemStyle-Width="13%"> <ItemStyle Width="13%"></ItemStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="User.FullName" DataType="System.String" HeaderText="Author" ForceExtractValue="InEditMode" ReadOnly="true" SortExpression="User.FirstName" UniqueName="User.FullName" ItemStyle-Width="15%"> <ItemStyle Width="15%"></ItemStyle> </telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="FileName" HeaderText="File" SortExpression="FileName" UniqueName="FileName" EditFormHeaderTextFormat=""> <ItemTemplate> <asp:HyperLink ID="lbPorfiles" runat="server" NavigateUrl='<%# UploadPath+"/"+Eval("ProposalFK")+"/"+ Eval("User.Login") +"/"+ Eval("FileName")%>' Target="_blank" Text='<%# Bind("FileName")%>'></asp:HyperLink> </ItemTemplate> <EditItemTemplate> <div style="left"> <telerik:RadUpload ID="rdProfile" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="5" Localization-Add="Add More Files" EnableFileInputSkinning="true" ControlObjectsVisibility="AddButton" MaxFileSize="1000000" OnClientFileSelected="ValidateExtension" AllowedFileExtensions=".doc,.pdf,.ppt,.xls" OnClientAdded="addTitle" Skin="Office2007" Width="95%" InputSize="35"> <Localization Add="Add More Files" /> </telerik:RadUpload> <span id="fileExtentionError" class="error" style="display:none; color:#cc0000; font-weight:bold">* Invalid file extensions. Only the following file formats can be uploaded: .doc,.pdf,.ppt,.xls</span> <span id="nullDescriptionError" class="error" style="display:none; color:#cc0000; font-weight:bold">* Please enter Description</span> <span id="overDescriptionError" class="error" style="display:none; color:#cc0000; font-weight:bold">* Please limit Description to 150 characters or less</span> <asp:CustomValidator Text="" runat="server" ID="FileUploadValidator" OnServerValidate="FileUpload_ServerValidate" ClientValidationFunction="ValidateFileUpload" /> <%-- *Invalid file extensions. Only the following file formats can be uploaded: .doc,.pdf,.ppt,.xls </asp:CustomValidator> --%> <script type="text/javascript"> function ValidateFileUpload(source, arguments) { var radGrid = $find('<%= rgGrid.ClientID %>'); var radUpload = $telerik.findControl(radGrid.get_element(), "rdProfile"); var fileInputs = radUpload.getFileInputs() var isValid = true; //var descValue = $get('<%= rgGrid.ClientID %>' + 'Title' + i).value var descValue = $get(radUpload.getID() + 'Title' + i).value //alert(descValue) for (var i = 0; i < fileInputs.length; i++) { } arguments.IsValid = isValid; } var i = 0 function addTitle(sender, args) { var inputRow = args.get_row(); var fileInputSpan = inputRow.getElementsByTagName("span")[0]; var tAddField = sender.getID("Title"); $(".ruInputs li[class='']:last span").after($("<textarea rows=3 cols='50'/>").attr("id", tAddField).attr("name", tAddField)).after($("<label class='fileInputLabel'>Description : </label>").attr("for", tAddField)).before($("<label class='fileInputLabel'> File : </label>").attr("for", fileInputSpan)); } </script> </div> </EditItemTemplate> </telerik:GridTemplateColumn> </MasterTableView> </telerik:RadGrid>to get the grid control
and
var radUpload = $telerik.findControl(radGrid.get_element(), "rdProfile");
to get the upload control
When I try to retrive the value of the additional field by code similar to
var descValue = $get(radUpload.getID() + 'Title' + i).value
I am getting javascript error saying "object needed"
Anyone can help?
I attached my code
Me
.rlbProgram.Items.Insert(0, New RadListBoxItem("[ ALL ]", 0))
-- Code that I use to loop through the listbox to select them all when '[ ALL ]' is clicked.
Select
Case Me.rlbProgram.SelectedIndex
Case 0
For i As Integer = 1 To Me.rlbProgram.Items.Count - 1
Me.rlbProgram.Items(i).Selected = True
sPrograms.AppendFormat(
"<Program id='{0}'/>{1}", Me.rlbProgram.Items(i).Value, vbCrLf)
Next
End Select
| I ´m not using DatasourceID, and I don´t know why happend this. |
| This is a common error, some times happend. And I don´t know which is the problem. |
| Thank´s. |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Both DataSource and DataSourceID are defined on 'RadMenu1'. Remove one definition.
Source Error:
|
|
Stack Trace:
[InvalidOperationException: Both DataSource and DataSourceID are defined on 'RadMenu1'. Remove one definition.]
System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +10834996
System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e) +28
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
|
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053