Save and Save As in Telerik RichText Editor - c#

I am using Telerik RichTextBox Editor(the one like MS Office) in my WPF project. When I save a file, and attempt to save it again later after making changes it opens up the SaveFileDialog and asks for the file name even though I've already defined it and saved it (like it thinks I'm using Save As, rather than Save). How can I solve this issue??
I am using
<telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Size="Small"
SmallImage="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/save.png" Text="Save" />

Didn't got a solution yet from anyone. Working on it, have some progress using CustomSaveCommand. Will post a complete solution when I get one.
If anyone gets one before I do, I'll accept it. Thanks all.
Solution:
Got a solution. Created a custom OpenCommand using the CustomSaveCommand and radrichtextbox-Import/Export. Hold in a string variable, the full path of the file on open/save a document, and overwrite the file on next save without the filedialog. Also reset the variable on new file open. Hope it helps anyone who is searching for a solution. Cheers :)

You could possibly setup a custom filebrowser provider and do what you want in there, i.e. see custom filebrowsercontentprovider. Besides a few other bits and bobs just inherit from Telerik.Web.UI.Widgets.FileBrowserContentProvider class.
Here is a nice example of using a sql database for the files: sql database

Related

Is possible to save locally a view object in xamarin forms?

I need to save locally (on a file) a StackLayout object, because I need to save the current state of a page, so I was just wondering if could be possible.
EDIT: Solution
As I have seen, there is no solution!
This is because Views are not serializable, so it's neither possible to serialize the Views as a string (trust me, I have tried them all), the only way is to re-generate your page by saving and loading data of simple types such as int or string (because only simple data can be serialized).
According to your needs, I think you only need to save the user's data and restore it at startup.
You can use File Handling in Xamarin.Forms to save the user's data, and then rewrite the OnAppearing method every time it starts, and restore the data inside the method.
For more information about File Handling, please refer to:https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/data/files?tabs=macos#saving-and-loading-files

BLOB file to display via a GUI

This is more of a, "hey, any ideas on how to go about doing this?", type of question.
So,
I'm working on a READ-ONLY GUI in Visual Studios, that loads data from an Oracle database. -- I am currently stumped on how to go about doing something: Loading an BLOB file from the oracle database and having it display via the GUI, so that the person reading it would be able to download said file by clicking a logo or text field or whatever works really. The person wouldn't be the ones uploading files; they should just be able to download them from what the GUI is pulling from the database.
Keep in mind, this file should not be limited to a single file type, should be able to upload .pdf, .txt, .wordx, .png, etc)... from Oracle, into Visual Studio.
I'm not sure which tool to use, nor the best way to go about this.
Tried looking it up, haven't really found any examples worth-mentioning or ideas pertaining to loading FROM Oracle into displaying for C#.
Any examples or ideas would be much appreciated.
SQL Developer offers this feature - via Java. You asked about tools...

XAML markup extensions design time

https://xamlmarkupextensions.codeplex.com/
I'm having a problem using the xamlmarkupextensions library. This library provides the opportunity to Bind values from a resource file (resx) to different controls. Now this works perfectly, but I don't want to use the resource file... I would like to use my own database.
So I made a new database and tried some stuff and got it working. The only problem is that the value is not visible in design time... Does anybody here knows how this could work? Thanks in advance!

How to persist file uploads after validation error?

I have a form that requires a file to be uploaded as well as additional data (name, etc...) with validation on these fields. When an error occurs, the file has to be re-uploaded. Is there a way to keep the file after a validation error occurs? This is built in C# .NET.
Tried to google this but nothing helpful came up.
Thanks in advance!
You can't genually persist the file because of Security Purpose..
If page is posted and validation error occured, check for a file using the .PostedFile property, and if one exists, save it to a temp file. In Session, store a reference to the temporary file. (use javascript)
.PostedFile is a property of the FileUpload control.
Also, during my google research, I found AJAX RadControl related to your question..
http://www.telerik.com/help/aspnet-ajax/asyncupload-persist-uploaded-files.html
I'm taking a bit of a guess at what you're doing since you really can't persist a file... are you simply using a fileupload dialog box and taking it from there? If so, it's typical to put the file/path obtained from the dialog in a txt field, then do your post (upload) with a separate button.
This scenario assumes you want to persist the path/file name, but not the actual file.

Saving(storing) a TabPage

Microsoft Visual C# 2010 Express
I've been looking all day for a way to somehow save a TabPage containing runtime-added images and controls (the user can move them in the TabPage) so that they can be used later. I tried using serialization but it seams that you can't serialize interfaces. I'm using a SqlCe database but I couldn't find a way to store it there either.
Can someone please point me in the right direction?
Thanks in advance.
[Later edit]
Thank you for your answers. I've managed to do it following your advice, saving each controller's proprieties into the database. Basically, I'm not saving the controller, I'm recreating it every time I need it. It's a little messy but it solves my problem.
If you want to save in a database you need to create a table where to store all the information needed to restore the state of the interface.
Most likely, you will need to store some key data for each image you save:
Position, Size, Image source (possibly a file name or another resource), etc, depending on your needs.
You don't get a ready to use solution for that.
As Adi said, you have to do that manually by saving the key properties in database, have a look at Create And Host Custom Designers With The .NET Framework 2.0. It will help you with using the Visual Studio designer itself.
Note, you can download a sample of the designer and the source code exists as well.
Good luck!
Thank you for your answers. I've managed to do it following your advice, saving each controller's proprieties into the database. Basically, I'm not saving the controller, I'm recreating it every time I need it. It's a little messy but it solves my problem.

Categories