RadRibbonButton - SaveCommand - FolderBrowserDialog

4 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 24 Jun 2012 Link to this post

    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
  2. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 26 Jun 2012 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 26 Jun 2012 Link to this post

    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 >>

  5. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 27 Jun 2012 Link to this post

    Hi,

    that's it! Thanks so mutch!

    Bes Regards
    Rene
Back to Top