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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

custom lines in grid cell

Thread ID:





75309 Jul 21,2008 12:32 PM UTC Jul 22,2008 12:03 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On July 21, 2008 12:32 PM UTC

I am using syncfusion 5.2 grid control. In one of the columns i need to add lines of different style for example in
col[5]...row[1] there could be a dashedline in blue color
col[5]...row[2] there could be a dashedline in red color
col[5]...row[3] there could be a solid in red color
Is this possible in syncfusion grid.
I will be very thankful if anyone could help me with this.
Please find the attached image with this query.


Jisha Joy [Syncfusion]
Replied On July 22, 2008 12:03 PM UTC

Hi Prabhjeet,

Thank you for your interest in Syncfusion Product.

You have to handle CellDrawn event and you can draw the required lines. Please refer the codes:

this.gridControl1.CellDrawn += new Syncfusion.Windows.Forms.Grid.GridDrawCellEventHandler(gridControl1_CellDrawn);

void gridControl1_CellDrawn(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e)
GridControl grid = sender as GridControl;

if(e.RowIndex ==2 && e.ColIndex==2)


Pen myPen = new Pen(Color.Pink);
myPen.Width = 2f;
myPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
e.Graphics.DrawLine(myPen, new Point(e.Bounds.Left , e.Bounds.Top + 7), new Point(e.Bounds.Right, e.Bounds.Bottom -7 ));
e.Cancel = true;


Please try this and let me know if this helps.



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