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

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

4 Answers 73 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Glenn
Top achievements
Rank 1
Glenn asked on 18 Jun 2011, 01:45 AM
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.

4 Answers, 1 is accepted

Sort by
0
Glenn
Top achievements
Rank 1
answered on 20 Jun 2011, 10:03 PM
0
Glenn
Top achievements
Rank 1
answered on 20 Jun 2011, 10:05 PM
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?
0
Dobromir
Telerik team
answered on 23 Jun 2011, 09:10 AM
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.

0
Glenn
Top achievements
Rank 1
answered on 25 Jun 2011, 02:16 PM
I corrected the problem by swapping the RadTextBox out with the .Net <asp:Textbox>
Tags
FileExplorer
Asked by
Glenn
Top achievements
Rank 1
Answers by
Glenn
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or