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 CellType Issues

Hi All, I''m in the process of evaluating the essential grid to see if its suitable for use on the project I''m working on. Anyway whilst trying it out I came accross a few issues with the "RichText" CellType and wondered if any of you could help with them: 1) One thing we need to be able to do is display OLE objects within cells. The problem is that the default behavior of the RichText cell type is to only display an OLE object if there is enough room to show it completely (see attached zip). Is there a way of telling it to always display OLE objects? 2) Is there an easy way of getting the RichText cells to auto-size vertically so that, by default, they would increase their size to correctly display all text and OLE information? Thanks in advance, Colin Jack images_5232.zip

3 Replies

AD Administrator Syncfusion Team November 15, 2004 12:29 PM UTC

1) We are relying on the Windows Forms RichTextBox for this functionality. So, if you drop one of these controls on a form, and size it so the ole object is not fully visible, does it show the partial object. If not, then it would first have to work at this level before we could try to make it work in a grid cell. If you can post a sample showing exactly the ole object you want to embed we can try to look at it here. 2)If you look at the bottom of this foreign thread there is a sample there that shows how to support an in-place editing richtext cell that does have some support for autosizing. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15023


CJ Colin Jack November 16, 2004 07:10 AM UTC

Hi Clay, I''ve included a project displaying a RichTextBox on a form. The document displayed in the RichTextBox is too large and was created by embedding an OLE object. This seems to display fine, with vertical scroll bars letting you navigate. The problem I had when displaying this sort of document in your grid was that the embedded OLE object would only display if there was enough room to display all of it. Unfortunately, after coming back from holiday yesterday, I just found out that my evaluation period for Essential Grid has run out so I havent been able to try this again. Thanks, Colin RichTextEmbedTest_5128.zip


AD Administrator Syncfusion Team November 16, 2004 09:04 AM UTC

The reason this is not working is that when the nonactive richtext cell is being drawn, we use a static method named RichTextPaint.DrawRichText in our code to statically draw richtext. This routine only draws text and does not display embedded Ole objects in the RTF. The reason we do this is for performance. So, you could derive your own RTF cell similar to what is done in the forum link referenced above, and instead of calling RichTextPaint.DrawRichText to draw the static text, do something else that would display the OLE object. One technique is to use a second RichTextBox, size it like the cell, position it off the screen, and put the rtf in it holding the ole object. Then take a snapshot of it to get a bitmap showing the RTF cell properly displayed, and then draw this bitmap in the grid cell. This is the type of thing that we do in some of our samples like the grid\samples\CellTypes\Calendar sample. Without actually implemeting the code, I am not sure whether you would run into any glitches trying to do this with a RichTextBox or not.

Loader.
Live Chat Icon For mobile
Up arrow icon