Click here to Skip to main content
15,795,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
ok I have a c# windows forms program that I am making in Visual Studio 2013
I had a text box set to databinding text property to a table in my sql database
using a dataset
so my data was auto saved from text box to the database and read back to textbox
I needed to change my textbox to a richtextbox so that I could bold, change color etc.. the font.
I do not see how to bind and read back the rtf property using databinding
I tried this

notesRichTextBox.DataBindings.Add(new Binding("Rtf", MyProgramDataSet.RTFTable, "RTF"));
but it only put some rtf data in the colomn and displayed nothing back in the richtextbox when I reopened the form
I tried setting the notesRichTextBox.Text = notesRichTextBox.Rtf and it just showed all of the underlying rtf code/text

Please help
I also tried at the beginning to set the databinding using the VisualStudio interface but Rtf doesn't seem to be an option

CodeProject is your friend; the best way to show your appreciation for that friendship is to search CP for articles, and answers, that may assist you, and study them.

I think this is directly related to what you want to do: "A RichTextBox that can Bind to the RTF Property" [^].

Also, see: [^].
Share this answer
DonaldTar 16-Oct-14 15:48pm    
While these solutions help me learn they are still not quite the same as what I am dealing with can I upload my code for someone to better help

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900