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

Suggestions please

2 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Declan
Top achievements
Rank 2
Declan asked on 14 Aug 2008, 11:13 AM
I am not sure if I should post here or in Upload!

I have a requirement to attach files to entries in a grid. A user can add rows to the grid and in some cases may wish to attach files for upload. At the moment I have a grid on the form followed by the upload control. The user adds all the rows and then uploads files. If the grids row count is > 0 then the upload is visible.

The difficulty here is that I have no way to identify which files relate to each row in the grid.

Ideally I would like to have a button in the grid that will show an upload control allowing me to upload files for the current grid row attaching an id value to the uploaded file. After upload I will show a list of uploaded files in a grid column and hide the upload control.

Is this possible and if so how? Then could the user remove uploaded files?

Is there a better way of achieving this?

Thanks in advance,
Declan

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 19 Aug 2008, 09:47 AM
Hello Declan ,

You can add a column to your RadGrid columns collection with a button which shows up the Upload control. You could handle the grid ItemCommand server event and thus make the upload visible on button click. There you can also retrieve the id of the row where the button was clicked in order to use it when saving the uploaded files.

Find more about RadGrid sever side API in the following resources: 
http://www.telerik.com/help/aspnet-ajax/grdgettingfamiliarwithserverapi.html
http://www.telerik.com/help/aspnet-ajax/grdretrieveprimarykeyfieldvaluesforitems.html

For your convenience I prepared a sample project illustrating the suggested solution attached to this post.

Let us know if this helps.

Kind regards,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Declan
Top achievements
Rank 2
answered on 19 Aug 2008, 04:44 PM
Hi Iana,

Excellent, just what I was looking for, thank you.

Regards,
Declan
Tags
Grid
Asked by
Declan
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Declan
Top achievements
Rank 2
Share this question
or