3 Answers, 1 is accepted
You need to call Execute method of the SaveCommand property as in this line of code:
this
.radRichTextBox.Commands.SaveCommand.Execute();
For more detailed information, please refer to this help article where you can find list of all commands exposed by RadRichTextBox and examples for their using with UI elements. You can also take a look at the Import/Export article which contains snippets of how you can save the document to a stream (which can happen without using the open and save file dialogs.
I hope this helps. Don't hesitate to contact us if you have other questions.
All the best,
Vasil
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Here is my code:
Private
Sub
MnuQuit_Click(sender
As
Object
, e
As
System.Windows.RoutedEventArgs)
Handles
MnuQuit.Click
If
bNeedToBeSaved
Then
If
MsgBox(
"Do you want to save the file?"
, vbYesNo + vbQuestion,
"The document need to be saved"
) = vbYes
Then
editor.Commands.SaveCommand.Execute()
'I want to continue only when the save command is done.
End
If
End
If
End
End
Sub
Thanks a lot,
Patrick
Currently, the work in Save and Print is executed asynchronously using Dispatcher.BeginInvoke(). This was part of a workaround for a legacy issue related to ApplicationMenu in RadRibbonView. We will remove it and the fix will be included in the Latest Internal Build (expected next week), so you will be able to continue working with your application then. Unfortunately there is no good workaround with the current version.
After upgrade, you will be able to listen to RadRichTextBox.CommandExecuted event and perform your logic there:
this
.radRichTextBox.CommandExecuted += (s, a) =>
{
if
(a.Command
is
SaveCommand)
{
// your logic here
}
};
Please, excuse us for the inconvenience. We have added points to your account for the report. Don't hesitate to contact us if you have other questions.
Greetings,
Vasil
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>