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
close icon

RichText Cells not refreshing correctly

Hi I have a grid with three columns. Col1 type=Checkbox, Col2 and Col3=RichText. The problem I have is that when I make the data of any particular cell bold and a different size for example, and then use the mouse to navigate up and down the grid, surrounding cells seem to inherit the style of the previous RTF cell, and then revert to their correct style. So for example, C1:R1="Hello" (in size 15 and bold), C1:R2="Hello" without any formatting, but when I scroll, C1:R2 text will take on the format of C1:R1. Is there any kind of way of locking-in the format so that this kind of error does not occur? Many thanks Error3_6508.zip

2 Replies

AD Administrator Syncfusion Team August 12, 2004 02:52 PM UTC

Is this a GridDataBoundGrid? If so, what are you storing in your DataSource? It would have to be actual RTF text (a string including the rtf formatting information, and not just a string containing the raw text). Here is a thread that works through this problem (among others). http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12809


PN Paul N August 13, 2004 10:50 AM UTC

Aha! Thanks. Answer lies in just setting the text value of the control rather than the underlying rtf value. On my populate routine, I''ve added an extra check for RTF controls and made use of a RichTextBox control as you suggested to derive RTF values for the grid element itself. Dim objRTF as New RichTextBox If i_objSyncGrid(intRowLoop + 1, intFieldRef).CellType = "RichText" Then objRTF.Text = vbNullString objRTF.SelectedText = strDisplayValue i_objSyncGrid(intRowLoop + 1, intFieldRef).CellValue = objRTF.Rtf Else i_objSyncGrid(intRowLoop + 1, intFieldRef).Text = strDisplayValue End If Thanks again for you guidance Paul >Is this a GridDataBoundGrid? If so, what are you storing in your DataSource? It would have to be actual RTF text (a string including the rtf formatting information, and not just a string containing the raw text). Here is a thread that works through this problem (among others). > >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12809

Loader.
Live Chat Icon For mobile
Up arrow icon