This is a migrated thread and some comments may be shown as answers.
Using RadEditor with FileExplorer
1 Answer 27 Views
This is a migrated thread and some comments may be shown as answers.
mbd
Top achievements
Rank 1
mbd asked on 31 Dec 2009, 12:52 AM
I've been experimenting with the FileExplorer, specifically connecting the FileExplorer to a SQL DB based on this article. So far, this solution seems to be a fit for my current needs. But, I'd like to see if I can extend the functionality so that when certain files are opened they are opened in a RadEditor (or other text editing control - but I'd prefer a RadEditor). For example, I want to be able to edit a text file (.xml, .txt, etc...) and ultimately save the changes.

I believe the above example relies on a DBContentProvider as well as a handler, which I'm not yet quite grasping, and I suspect this might effect how a RadEditor solution is implemented. So, I'm hoping someone can help me solve my objective.

I'd also like to ask for suggestions on learning resources or the like where I can learn more about what's going on here. I know the code here says a lot but there's much of it that is still way over my head. I'm hoping for something (book, video, etc...) that "holds my hand" as it explains the ins and outs of what's going on. Perhaps a bit much to ask for but I thought I'd throw it out there.

Many thanks,
Michael

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 04 Jan 2010, 04:11 PM
Hello Mbd,

In order to implement the desired behavior I recommend you follow these steps:
  • Attach a handler to the OnClientFileOpen event of the RadFileExplorer
  • Cancel opening of the default RadWindow (args.set_cancel(true)) and get the path to the opened file (args.get_path()) as shown in this example
  • I recommend you wrap the RadEditor control in a RadAjaxPanel (or use RadAjaxManager)
  • Please check this articles for more information.
  • Read the content of the file in the AjaxRequest server-side handler by using the passed path and assign its content to the Content property of the RadEditor content. 
  • Use the approach shown in this online demo in order to load content from DataBase to the RadEditor and store the content from the RadEditor to DataBase.

More details about the implementing a FileBrowserContentProvider can be found in this article.
I hope this helps.


Greetings,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Asked by
mbd
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or