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

RadRibbonButton - SaveCommand - FolderBrowserDialog

3 Answers 81 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 24 Jun 2012, 12:26 PM
Hi,

is it possible to set the Root-Fodler of the FolderBrowserDialog from the  RadRichTextBoxribbonUI? <telerik:RadRichTextBoxRibbonUI>
lderBrowserDialog dialog = new FolderBrowserDialog();
dialog.SelectedPath = programFiles;
dialog.ShowDialog();

in the Backstage Area i use this RadRibbonButton and the : telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}"
<telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="pdf" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="True" Width="90">
   <StackPanel Width="90">
      <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/Pdf.png" Stretch="None" />
   </StackPanel>
</telerik:RadRibbonButton>

Is it possible to set the RootFolder of the "SaveCommand"??? Something like RadRibbonButton.FolderDialog.SelectedPath= ??

Thanks a lot
Best Refards
rene

3 Answers, 1 is accepted

Sort by
0
ITA
Top achievements
Rank 1
answered on 26 Jun 2012, 06:31 AM
Hi,

In my FileBrowserDialog the user can save the document as a pdf-file. But i want to save the document as html file two.
How can i do this after the Dialog ist closed?

Best Regrads

Thanks
Rene
0
Iva Toteva
Telerik team
answered on 26 Jun 2012, 03:51 PM
Hello Rene,

Please refer to this forum post for a sample implementation of a custom save command. The code of the command is very similar to the one of the default SaveCommand.

As mentioned in the post in the other thread, this custom save command opens a specific directory on start-up by setting the InitialDirectory of the SaveFileDialog.

When it comes to the formats that the custom command can save to, this is determined by the format providers that have been added as references. If you would like, you could change it in the code of the custom command.

As for saving the file after the dialog is closed, you can use the format providers programmatically as described in this article. Here is an example of how you can write the document of the editor to a file in any of the supported file formats:

FileInfo file = new FileInfo(filePath);
using (Stream stream = file.OpenWrite())
{
    provider.Export(this.editor.Document, stream);
}

I hope this helps.

Regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
ITA
Top achievements
Rank 1
answered on 27 Jun 2012, 08:13 AM
Hi,

that's it! Thanks so mutch!

Bes Regards
Rene
Tags
RichTextBox
Asked by
ITA
Top achievements
Rank 1
Answers by
ITA
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or