How to implment the FileExplorer / File Selector Dialog Demo from a RadGrid EditItemTemplate

5 posts, 0 answers
  1. Glenn
    Glenn avatar
    4 posts
    Member since:
    Jan 2011

    Posted 17 Jun 2011 Link to this post

    I'm trying to implement the demo as is, but the only difference is that I want to use it in the EditItemTemplate of the RadGrid.
    Upon compile it gives me an error (CS0103: The name 'txbImage' does not exist in the current context) on the

    function OnFileSelected(fileSelected) {var textbox = $find("<%= txbImage.ClientID %>");textbox.set_value(fileSelected);}
     
    which makes sense because txbImage (textbox) does not exisit when the page is first rendered.  I've tried to add with ClientScript.RegisterClientScriptBlock()  but have not found an event in which to add the Javascript function where it works.

    I get thi error reported by FireBug when I double click on the file from the Explorer:

    openerPage.OnFileSelected is not a function

    1)Is what I'm trying to do possible?
    2) how would I change the demo to work in this manner?  I want to be able to pick a file from the explorer while in edit mode interacting with a row in the grid.

    thank you.

  2. Glenn
    Glenn avatar
    4 posts
    Member since:
    Jan 2011
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Glenn
    Glenn avatar
    4 posts
    Member since:
    Jan 2011

    Posted 20 Jun 2011 Link to this post

    One issue I still have is that once the file is selected the path and filename does not display in the textbox until I click on the textbox.  Is there an event I can call on the grid after selecting the file so that the text is displayed immediatly in the textbox?
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 23 Jun 2011 Link to this post

    Hi Glenn,

    I am not quite sure what may be causing the reported problems. The only modification that has to be done to the RadFileExplorer's FileSelector demo is that you need to pass the correct ClientID of the textbox because the grid is a naming container. To ensure that you are using the correct ID you can assign handler to the RadTextBox OnLoad Client-Side event and pass its ID to a global variable.

    For your convenience I have prepated a sample page using FileSelector demo in RadGrid's EditItemTemplate, please find it attached.

    All the best,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Glenn
    Glenn avatar
    4 posts
    Member since:
    Jan 2011

    Posted 25 Jun 2011 Link to this post

    I corrected the problem by swapping the RadTextBox out with the .Net <asp:Textbox>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017