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

RadGrid/Attachment Functionality in Template?

1 Answer 219 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 31 Jul 2015, 05:08 PM

Hi All

Hopefully I'm explaining this clearly ... I'm pretty new to using the rad controls and any help would be appreciated.

I'm trying to find a way of allowing an attachment/file to a new record within a RadGrid that get's uploaded along with the Insert/Update command but I can't seem to figure out a solution. I initially tried using asp:FileUpload but quickly realized that it requires a postback. When I get the FileUpload object (since a postback has not occured) the the control has HasFile returns false even though I "attached" a file.

I also tried using the Rad but keep getting the same results.

Regards

Ralph

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 05 Aug 2015, 07:08 AM
Hello Ralph,

You can directly use a GridAttachmentColumn to upload/download files via your grid:
http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/column-types/defaultcs.aspx

Alternatively, you can use a GridTemplateColumn and place a RadAsyncUpload control in its EditItemTemplate container:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/column-types#template

You can also check the following section for accessing the control on code-behind:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Ralph
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or