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

FileUpload inside EditItemTemplate

1 Answer 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Richard asked on 26 Mar 2009, 12:41 PM
Wow I am really posting alot of problems lately :(

I have tried both ASP:FileUpload and RadUpload for this and still the same problem. 
I have a FileUpload inside EditItemTemplate.

What I need to do is access this control and find the filename, FileBytes(), FileSize etc. upon inserting.

After reading http://www.telerik.com/help/aspnet-ajax/grdinsertupdatedeleteatdatabaselevel.html, I have attempted to access the control via:


Unfortunately, although I can read the other column controls that are textboxes, I am unable to ready any data from the fileUpload control. :(

ASPX:

 

               <telerik:GridTemplateColumn HeaderText="File" UniqueName="TemplateColumn">  
                    <EditItemTemplate> 
             <%--           <telerik:RadUpload ID="ruFile" runat="server" ControlObjectsVisibility="None" MaxFileInputsCount="1">  
                        </telerik:RadUpload>--%> 
                        <asp:FileUpload ID="ruFile" runat="server" />   
                    </EditItemTemplate> 
                </telerik:GridTemplateColumn> 

VB:

    Private Sub rgResource_InsertCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgResource.InsertCommand  
        Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)  
        Dim fileup As FileUpload = TryCast(insertedItem("TemplateColumn").Controls(1), FileUpload)  
    End Sub 

 

 

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 2
answered on 26 Mar 2009, 04:15 PM
Tags
Grid
Asked by
Richard
Top achievements
Rank 2
Answers by
Richard
Top achievements
Rank 2
Share this question
or