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

Use a input type file inside the Grid

6 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Barry
Top achievements
Rank 1
Barry asked on 21 Mar 2011, 10:46 AM
Inside my Grid (please see attached file), when clicking the Edit button, instead of having the typical textbox, I would like to have a input type=file control. I would like to make the user be able to see a browse a file. Is this possible ?

6 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 21 Mar 2011, 11:21 AM
Hello Barry,

We have a code library that demonstrates exactly how to replace the default editor with a file upload.
Please see the sample here - Upload in Grid

I hope this helps.

Best Regards,
Tsvetomir Tsonev
the Telerik team
0
Barry
Top achievements
Rank 1
answered on 22 Mar 2011, 03:10 AM
Thanks Tsvetomir for the response. Unfortunately, I am unable to open the solution since I am only using MVC 2. Can you provide me a copy that is compatible to MVC 2?

0
T. Tsonev
Telerik team
answered on 22 Mar 2011, 09:34 AM
Hello Barry,

The project does not rely on any MVC3-specific features and can be easily converted. I'm attaching you the MVC2 version.

Best Regards,
Tsvetomir Tsonev
the Telerik team
0
strogen
Top achievements
Rank 1
answered on 15 May 2011, 11:27 AM
Hello Tsvetomir ,

Thanks for your excellent example.
But in case, when i want to use upload control with grid in insert mode, i have error in getDataItem js function.
Can you help to resolve it?

Best regards,
Roman.
0
T. Tsonev
Telerik team
answered on 16 May 2011, 10:35 AM
Hello Strogen,

The logic of the demo application is greatly simplified and does not cover the insert scenario.
We need to do a couple of things to support it:
  • Store the uploaded file in a temporary location until the user submits the insert form
  • Associate the uploaded file with the newly created record

In addition, the onUpload and onSuccess handlers need to be modified to work in both the insert and edit scenarios.

I've updated the project with these changes, but please note that this is just a proof of concept and not a production code.

Regards,
Tsvetomir Tsonev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
strogen
Top achievements
Rank 1
answered on 16 May 2011, 06:03 PM
Hello Tsvetomir ,

It's fantastic!!
This code work fine!

Thank you very much!
Tags
Grid
Asked by
Barry
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Barry
Top achievements
Rank 1
strogen
Top achievements
Rank 1
Share this question
or