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

custom lines in grid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

75309 Jul 21,2008 08:32 AM Jul 22,2008 08:03 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 21, 2008 08:32 AM

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.



Lines_8b1dc169.zip

Jisha Joy [Syncfusion]
Replied On July 22, 2008 08:03 AM

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.

Regards,
Jisha


CONFIRMATION

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.

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.

;