Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VS2008 C# WPF
I have html files data which are with .htm extension...i want to open that file in rich text box in WPF..how can i do it..my code is below...but it gives error that 'HTML Format' data format not supported.
Parameter name: dataFormat

   richTextBox_LessonView.Document = new FlowDocument();
                TextRange documentTextRange = new TextRange(
                    richTextBox_LessonView.Document.ContentStart, richTextBox_LessonView.Document.ContentEnd);
 
                using (FileStream fs = File.Open("softskill.htm", FileMode.Open))
 
                    documentTextRange.Load(fs, System.Windows.DataFormats.Rtf);
Posted 17-Jun-11 23:24pm
vishal_h1.6K
Edited 17-Jun-11 23:40pm
ambarishtv10.5K
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
vishal_h at 18-Jun-11 6:01am
   
thanks but i am using VS2008 and that application is in vs2010 so some method are not working...
Monjurul Habib at 18-Jun-11 6:07am
   
google and you will find those for vs2008. :)
vishal_h at 18-Jun-11 6:11am
   
Sir i refer this http://www.codeproject.com/KB/WPF/WPFRichTextEditor.aspx link..download and working with this..
but i have two GB data which is in .htm extension and not opening in that rich text box..
could you please help me..i try at my best but as i am fresher i am not getting...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 446
1 OriginalGriff 325
2 Yogesh Kumar Tyagi 304
3 Maciej Los 235
4 Prakriti Goyal 200
0 OriginalGriff 6,417
1 Sergey Alexandrovich Kryukov 5,344
2 Maciej Los 3,434
3 Peter Leow 3,259
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 18 Jun 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100