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

trapezoidal cells?

Hi, Im building a grid where the columns are narrow but the headers are wide. At the moment, ive oriented the text in the headers vertically, but its hard to read. Id like to orient the header text on a 45 degree angle, but that requires the header cells to be wider. Is there any way I could make the headers themselves also be oriented on a 45 degree angle? i.e. to be drawn as trapezoids rather than rectangles?

3 Replies

AD Administrator Syncfusion Team August 3, 2004 08:10 AM UTC

I think you will have to do this yourself. One complicating issue is that as the borders slant, they no longer ''live in a single cell''. So, any drawing to do this has tro draw over several cells. This makes it difficult to use teh cell oriented drawing events like DrawCell, DrawCellborder or CellDrawn. But you can try to do something in grid.paint. Here is a minimal try at it. SlantedHeaders_1620.zip


DM damien morton August 3, 2004 09:45 AM UTC

Is there a way I can specify TextRenderingHint.AntiAlias for a given cell?


AD Administrator Syncfusion Team August 3, 2004 12:26 PM UTC

You can set this grid-wide using the PrepareGraphics event and seting the RenderingHint there. To do it on a particular cell, you could try handling the DrawCell event to set it(, and maybe the CellDrawn event to reset it if necessary). TextRenderingHint save; private void gridControl1_DrawCell(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) { if(e.RowIndex == 2 && e.ColIndex == 2) { save = e.Graphics.TextRenderingHint; e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias; } } private void gridControl1_CellDrawn(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) { if(e.RowIndex == 2 && e.ColIndex == 2) { e.Graphics.TextRenderingHint = save; } }

Loader.
Up arrow icon