Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Fileupload control with use in GridView. If i take in outside then can be change but I want to use this control inside(GridView update event). Pls help me.
Posted
Updated 9-Apr-12 10:51am
v2

1 solution

XML
GridView On the Page

<asp:TemplateField HeaderText="File Attachment" sortExpression="strFileAttachment">
                <ItemTemplate>
                    <p>
                        <%#Eval("strFileAttachment")%>
                    </p>
                </ItemTemplate>

                <EditItemTemplate>
                    <asp:FileUpload ID="FileUploadFileAttachment"     runat="server" />                    
                </EditItemTemplate>

</asp:TemplateField>


Core behind is

C#
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)

{

FileUpload FileUpload1 = (FileUpload)GridView1.Rows[e.RowIndex].FindControl("FileUploadFileAttachment");

}

I think this may solve your problem.
Let me Know if it will work for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900