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

Drawing a marker when Margins are too large

Hi, I have a virtual grid control in which sometime the TextMargins are so large that the cell doesn''t display anything. In those cases I would like to draw a marker (ellipses or something) to indicate that the cell does have a value, it just can''t be displayed. However, I don''t get a DrawCellDisplayText event in these instances (because the cell renderer RemoveMargins returns an empty text rectangle), and the OnDrawItem and OnCellDrawn events don''t seem to provide quite enough information to be sure whether something was drawn. My best idea at this point is to include a flag in the DrawCellDisplayText event and if it isn''t set in the CellDrawn event to assume that I need to draw my marker. Do you have any suggestions or comments? Sue

1 Reply

AD Administrator Syncfusion Team August 15, 2005 02:56 AM

There is a style.Trimming you can set to show ellipsis when text does not fit. But if there is no room in the textrectangle for the ellipsis + 1 char, the ellipsis will not display. And it sounds like you do not have this much space available to you. So, I think your solution will probably work. But in addition to checking whether your flag is set in CellDrawn, I think you would also want to test whether the style.FormattedText is positive length. Otherwise, I think you would be showing your ellipsis for empty cells as well as occupied cells that do not fit.

Loader.
Live Chat Icon For mobile
Up arrow icon