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


Thread ID:





55010 Jan 22,2007 06:03 PM UTC Jan 23,2007 10:42 AM UTC WinForms 1
Tags: XlsIO
William Brown
Asked On January 22, 2007 06:03 PM UTC

Is it possible to determine the border properties of a cell, top, left etc from an existing sheet? For instance, I need to get all the border information from a cell on a template sheet then set only the top border of cell of the destination sheet.

Melba Winshia [Syncfusion]
Replied On January 23, 2007 10:42 AM UTC

Hi Bill,

Thanks for your interest in Essential XlsIO.

Yes, it is possible to determine the border properties of a cell.

1) Please refer the following code snippet to set the border [top, bottom, left and right] linestyle.


// Setting Border LineStyle - Bottom
sourcesheet.Range["B2"].CellStyle.Borders[ ExcelBordersIndex.EdgeBottom ].LineStyle =ExcelLineStyle.Dash_dot;

// Setting Border Linestyle - Left
sourcesheet.Range["B2"].CellStyle.Borders[ ExcelBordersIndex.EdgeLeft ].LineStyle = ExcelLineStyle.Dash_dot;

// Setting Border Linestyle - Right
sourcesheet.Range["B2"].CellStyle.Borders[ ExcelBordersIndex.EdgeRight ].LineStyle = ExcelLineStyle.Dash_dot;

// Setting Border Linestyle - Top
sourcesheet.Range["B2"].CellStyle.Borders[ ExcelBordersIndex.EdgeTop ].LineStyle = ExcelLineStyle.Dash_dot;

2) Please refer the following code snippet to get the border information from a cell and then set the top border of cell of the destination sheet.


//Applying the border linestyle to the destination sheet.

destsheet.Range["B2"].CellStyle.Borders[ExcelBordersIndex.EdgeTop].LineStyle=sourcesheet.Range["B2"].CellStyle.Borders[ ExcelBordersIndex.EdgeTop ].LineStyle;

Please refer the following sample which implements the above said feature:


Please take a look and let me know if you have any other questions.

Best Regards,


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