how to show Richtextbox.rtf in datagridview

rajesh.forum

Well-known member
Joined
Sep 7, 2007
Messages
55
Programming Experience
Beginner
Hi all!!
Im using database which is created in "UTF8" encoding format. I need to save the "richtextbox.rtf" in the database and to show as text in datagridview column.Here, from the datarow am converting to .rtf and again assigning the text of richtextbox to the datagridview....But the error rises as
"frile format is not valid".The font set on the grid is "Arial Unicode MS"

rtxtBox.Rtf = dr("answer").ToString.Trim
drAns("Answer") = rtxtBox.Text
drAns("AnswerRTF") = rtxtBox.Rtf

please help with ur idea soon as possible.,
rajesh.
 
If you have plain text in Answer and RTF in AnswerRTF, why do you put Answer in RTF?
 
If you want to render RTF text in a DataGridView you'll need to create your own column, cell and editing control classes. MSDN has an example for hosting a DateTimePicker so you'll do a very similar thing.
 
Back
Top