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

Pass filePath to radgrid modal edit template

2 Answers 34 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ric
Top achievements
Rank 1
Ric asked on 08 Jul 2014, 02:07 PM
Hello,

I have a radGrid which includes an "Add New" form. This form is set as a modal popup form and includes a file selector set up exact like this demo:

http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/client-sideapi/fileselectordialog/defaultcs.aspx

My problem comes with trying to get the filePath back to the textbox in the radgrid form template. Currently when I double click a file nothing happens. The file explorer does not close and I do not get the file path populating my textbox. All of my code is identical to the above demo except for the fact that the file explorer dialog and filepath textbox reside within a radgrid editform template.

Any advice/insight is greatly appreciated!

Thanks,
Ric

2 Answers, 1 is accepted

Sort by
0
Ric
Top achievements
Rank 1
answered on 08 Jul 2014, 04:50 PM
To add more info,

I think the problem lies in referencing the textbox in Javascript. Here is the code that seems to be holding up the process:

                                                 function OnFileSelected(fileSelected) {
                                                 var grid = document.getElementById("<%=gridDocs.ClientID%>"); 
                                                     var textbox = grid.getElementsByTagName("txtFilePath");
                                                 textbox.set_value(fileSelected);
                                             }

The error is raised on the "set_value".

0
Vessy
Telerik team
answered on 10 Jul 2014, 02:41 PM
Hi Ric,

I assume that the "txtFilePath" is an Id of an element, but not a tag name as refered in the provided by you code snippet. The getElementsByTagName function returns a list of elements with the given tag - please refer this MDN article for more detailed information.

Regards,
Vessy
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
FileExplorer
Asked by
Ric
Top achievements
Rank 1
Answers by
Ric
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or