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

[Solved] RadFileExplorer using with radgrid

4 Answers 249 Views
Editor
This is a migrated thread and some comments may be shown as answers.
SonicImaging
Top achievements
Rank 1
SonicImaging asked on 01 Dec 2008, 02:22 PM
Hi,

I'm trying to incorporate the RadFileExporer inside my radgrid edit form to select a image.   I have it working with the open button in a grid templatecolumn and the Explorer.aspx file but I cant figure out how to get the file value back to the text field in the edit form.

In my grid page I added the OnFileSelected java but I relized that it wont be able to find the text control to set the value for saving back to the database.

So basiccly I want to have the textbox with the filename,  then a open button to select the file from explorer.aspx in a radwindow then have it put the filename value in the textbox in the edit form.

Are there any examples of this that I can look at?

Thanks
-Keith

4 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 03 Dec 2008, 10:38 AM
Hi Keith,

Take a look at the following file explorer example: http://demos.telerik.com/aspnet-ajax/Editor/Examples/FileExplorer/FileSelectorDialog/DefaultCS.aspx

It should help you in your scenario.

Kind regards,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
SonicImaging
Top achievements
Rank 1
answered on 03 Dec 2008, 12:22 PM
Thanks,  yea that's the example I used which is running fine or runs fine on a regular webpage, but since im adding this to a editform in a radgrid to select the filename for a imagefield in my database.   I cant figure out how to get the filename value back into the editform field since the javascript can only change the textbox outside the radgrid

Thanks
-Keith
0
Lini
Telerik team
answered on 08 Dec 2008, 08:23 AM
Hello Keith,

One way to do this is to get the ClientID property of the box on the server and store it in a hidden field in your template or some JavaScript variable. Here is some code that could help you:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
  if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
  { 
    GridEditFormItem editForm = (GridEditFormItem)e.Item; 
    System.Web.UI.WebControls.TextBox textBox = (System.Web.UI.WebControls.TextBox)editForm["ColumnUniqueName"].Controls[0]; 
    //use textBox.ClientID here 
  } 


Kind regards,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jaimie
Top achievements
Rank 1
answered on 01 Oct 2009, 03:20 AM
hey.

after selecting the file and passing the name back to the textbox. What should i do to save the textbox value of the file name back to the database? I am using EditForm mode of the grid bounded with a SqlDataSource with update, delete, insert commands defined.

Thanks
Tags
Editor
Asked by
SonicImaging
Top achievements
Rank 1
Answers by
Lini
Telerik team
SonicImaging
Top achievements
Rank 1
Jaimie
Top achievements
Rank 1
Share this question
or