We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Rich Text Editbox

I have a situation with a column containing a Rich Text Edit box. When the data is committed to the database, it transforms to wierd characters such as \rtf0. Could this have anything to do with the underlying data type for that field (it''s currently set at nvarchar(155)? Thank you.

6 Replies

AD Administrator Syncfusion Team May 4, 2005 06:53 PM UTC

Things like \rtf0 are part of the richtext formatting. Do you want to save RichText to the database? Doing so, would be the only way to see it again as richtext, as if you save it strictly as the text, you lose the RichText formatting. If you do not need the RichText formatting, you can just use a TextBox cell. To convert this richtext to text, you can create a instabce of a RichTextBox and set this richtext formatted string to the RichTextBox.Rtf property. Then you can get the unformatted text from the Text property.


JV John Valescu September 1, 2005 04:03 AM UTC

My clients like the pop-up editor feature of the RichText box, but don''t need the formatting features. I replaced it with a normal textbox that does word wrapping and expands, but they don''t like the way it alters the size of the cell in the grid. Is there some easy way to use the Rich Text control (as a member of a DataBound Grid) and just make everything text? Thanks! >Things like \rtf0 are part of the richtext formatting. Do you want to save RichText to the database? Doing so, would be the only way to see it again as richtext, as if you save it strictly as the text, you lose the RichText formatting. If you do not need the RichText formatting, you can just use a TextBox cell. > >To convert this richtext to text, you can create a instabce of a RichTextBox and set this richtext formatted string to the RichTextBox.Rtf property. Then you can get the unformatted text from the Text property.


AD Administrator Syncfusion Team September 1, 2005 07:37 AM UTC

I am not sure I understand your question? Do you want a popup control based on a Windows Forms TextBox? If so, you can use one of the two techniques shown in this sample that popups either a modal form or a modalless usercontrol. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\In Depth\DropDownFormAndUserControlSample


JV John Valescu September 1, 2005 01:12 PM UTC

No problem. I''ll try again. I guess I''m looking for the cell to have a dropdown button, like the RichTextControl. When the user clicks on it, it opens a window where they can edit their text comments. After closing the "edit window", the cell returns to its normal size. Much like the way the RichText control works now, except without and of the RichText features. Did I make this more complicated? >I am not sure I understand your question? > >Do you want a popup control based on a Windows Forms TextBox? If so, you can use one of the two techniques shown in this sample that popups either a modal form or a modalless usercontrol. >\Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\In Depth\DropDownFormAndUserControlSample


JV John Valescu September 2, 2005 03:50 AM UTC

Please forgive my ignorance. I''ve spent many hours researching the RTB control and its interaction with SQL server. From what I can tell, SQL can store the output from a RTB control into an nvarchar datatype. Since I don''t have to have the formatting characters saved, I could use (as you previously stated) the rtf.text property to get this info. My question is how do I get to this method to accomplish this? I am using a DBDG with column #20 (called "comments"). I''ve only used the designer interface to set this up and after choosing "Rich Text Box" as the control for that cell, I don''t see any additional properties. I guess I need more navigation. Thank you! >No problem. I''ll try again. I guess I''m looking for the cell to have a dropdown button, like the RichTextControl. When the user clicks on it, it opens a window where they can edit their text comments. After closing the "edit window", the cell returns to its normal size. Much like the way the RichText control works now, except without and of the RichText features. Did I make this more complicated? > > > >>I am not sure I understand your question? >> >>Do you want a popup control based on a Windows Forms TextBox? If so, you can use one of the two techniques shown in this sample that popups either a modal form or a modalless usercontrol. >>\Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\In Depth\DropDownFormAndUserControlSample


AD Administrator Syncfusion Team September 2, 2005 07:30 AM UTC

Why are you using RichText if you do not want to save richtext? Instead, it will be much simpler to just use regular text and display it it a regular textbox. Here is the sample suggested above modified to drop a textbox in the bottom 2 cells. http://www.syncfusion.com/Support/user/uploads/CS_c22d0bcd.zip

Loader.
Live Chat Icon For mobile
Up arrow icon