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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

trapezoidal cells?

Thread ID:





17173 Aug 3,2004 05:18 AM UTC Aug 3,2004 12:26 PM UTC WinForms 3
Tags: GridControl
damien morton
Asked On August 3, 2004 05:18 AM UTC

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?

Administrator [Syncfusion]
Replied On 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

damien morton
Replied On August 3, 2004 09:45 AM UTC

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

Administrator [Syncfusion]
Replied On 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; } }


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon