Pass filePath to radgrid modal edit template

3 posts, 0 answers
  1. Ric
    Ric avatar
    5 posts
    Member since:
    Aug 2013

    Posted 08 Jul 2014 Link to this post

    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. Ric
    Ric avatar
    5 posts
    Member since:
    Aug 2013

    Posted 08 Jul 2014 in reply to Ric Link to this post

    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".

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 10 Jul 2014 Link to this post

    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.

     
Back to Top