Retrieving the RTF from NRichTextViewWithRibbonControl


Author
Message
Steven Paplanus
Steven Paplanus
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 2, Visits: 3
I have a project where I need to save and load data from a Winforms app to a database, where a documentation form was built with the NRichTextViewWithRibbonControl that would be saved with the rest of the project information I need to persist.   I have been looking for a while, but can't seem to find a way to either send/retrieve or stream the RTF data from the control.  Is there any way to make this work?
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Steven,
All WPF / Winform controls in NOV are actually NOV hosts that wrap a certain NOV Widget. This Widget is exposed from the typed Widget property of the control. In the case of the "NRichTextViewWithRibbon" control this Widget is of type NRichTextViewWithRibbon. This widget in turn contains View and Ribbon properties that expose the functionality of the ribbon and the rich text view. So back to your question in oder to load / save content from the view you need to write something like:

nRichTextViewWithRibbonControl1.Widget.View.LoadFromFile("c:\\temp\\test.rtf");

You can also import rtf/docx etc. from in memory streams (this is the case when you read the content from a database for example):
nRichTextViewWithRibbonControl1.Widget.View.LoadFromStream(someStream, new NRtfTextFormat());

Hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team


Steven Paplanus
Steven Paplanus
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 2, Visits: 3
Perfect, that worked.  Thank you for you help.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search