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

Just a upload facility in radgrid

1 Answer 26 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 29 Aug 2010, 04:39 PM
Hi Friends,
I am using radgrid, i just want to give a user option to upload the file at server side, i went through all the demos of that upload control
but i don't want to give a option of editing the record to user, user will just click at browse button of upload control in row and he will select the file which he wants to upload (No editing of records just a upload of file for that particular row).
so how should i go through this please let me know.

Thanks in advance.
Manoj Gupta

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Aug 2010, 10:09 AM
Hello Manoj,


Add RadUpload control in ItemTemplate section of GridTemplateColumn in order to show upload in grid browser mode. The following code will help you in accessing RadUpload in "Upload" button_click event.

Code behind:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == "Upload")
    {
        GridDataItem item = (GridDataItem)e.Item;
        RadUpload radupload = (RadUpload)item.FindControl("RadUpload1");
    }
}


Where the ASPX I used is:
        . . .
    <telerik:GridTemplateColumn>
         <ItemTemplate>              
             <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="All">
             </telerik:RadUpload>
             <asp:Button ID="Button2" runat="server" Text="Upload" CommandName="Upload" />
         </ItemTemplate>
     </telerik:GridTemplateColumn>
 </Columns>
. . .

Hope this helps.

Regards,
Shinu.
Tags
Upload (Obsolete)
Asked by
Manoj
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or