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

Thin and Thik Border

Thread ID:

Created:

Updated:

Platform:

Replies:

57169 Feb 27,2007 11:36 AM UTC Mar 21,2007 06:28 AM UTC WinForms 6
loading
Tags: GridControl
Boris Jansen
Asked On February 27, 2007 11:36 AM UTC

Hello!

why is the border in excel (see picture) so thick and within my programm thin?

first i set no border for the whole grid and after this, i set only thinborders for spezial areas. any idea?

thanks boris

images25.zip

Administrator [Syncfusion]
Replied On February 27, 2007 10:54 PM UTC

Hi Boris,

We were not able to reproduce the issue here. Is it possible for you to upload us a sample or modify the attached sample to reproduce the issue here? This will help us to analyse the issue further.

Here is a sample.
GDBGExportRowHeader.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 16, 2007 09:28 AM UTC

hello!

please look at thread:

http://www.syncfusion.com/support/Forums/message.aspx?MessageID=52502

there is an example.

Regards,
Boris

Administrator [Syncfusion]
Replied On March 16, 2007 05:08 PM UTC

Hi Boris,

The reason for getting this behavior is that you are setting the GridBorderStyle to Solid in a cell. By default the GridExcelConverterControl does not care about the GridBorderWeight parameter while exporting the grid data to excel. Please find the code snippet from GridExcelConverterBase.cs file that convert the GridBorderStyle to ExcelLineStyle in a GridExcelConverterControlBase.

//Default code for converting GridBorderStyle into ExcelLineStyle.
[C#]
private ExcelLineStyle GetExcelLineStyle(GridBorderStyle gridLineStyle)
{
switch (gridLineStyle)
{
case GridBorderStyle.DashDot: return ExcelLineStyle.Dash_dot;
case GridBorderStyle.DashDotDot: return ExcelLineStyle.Dash_dot_dot;
case GridBorderStyle.Dashed: return ExcelLineStyle.Dashed;
case GridBorderStyle.Dotted: return ExcelLineStyle.Dotted;
case GridBorderStyle.None: return ExcelLineStyle.None;
case GridBorderStyle.NotSet: return ExcelLineStyle.None;
case GridBorderStyle.Solid: return ExcelLineStyle.Thick;
case GridBorderStyle.Standard: return ExcelLineStyle.Thin;

default: throw new ArgumentOutOfRangeException("Border style is out of range");
}
}

If you want to change the behavior then you need the modified code snippet in the GetExcelLineStyle method (file: GridExcelConverterBase.cs; Line Number :972 ) of the forum sample. Please let me know if this helps.

Best regards,
Haneef

Boris Jansen
Replied On March 20, 2007 09:24 AM UTC

Hi,

thank you for the code (perfect!!!!!). It helped, but how can i disable the default gridstyle within excel?

in excel i can set the option --> do not show gridlines. how can i do this within my code?

please have a look at the screenshots.

thank you very much.
boris

nogridlines.zip

Administrator [Syncfusion]
Replied On March 20, 2007 03:07 PM UTC

Hi Boris,

You can control the appearance of the grid line border using the IsGridLinesVisible property of the WorkSheet. If you want to hide the gridLines in a Excel then add the sheet.IsGridLinesVisible = false; statement in a GridToExcel method of the GridExcelConverterControl(150th line of the GridExcelConverterControl.cs file). Here is a modified code of the ExportChart sample.

public void GridToExcel( GridModel grid, string fileName, ConverterOptions options )
{
ExcelEngine engine = CreateEngine();
IWorkbook book = engine.Excel.Workbooks.Create( 1 );
IWorksheet sheet = book.Worksheets[ 0 ];

sheet.IsGridLinesVisible = false; ////Line Number 150..
GridToExcel( grid, sheet, options );

book.Close( true, fileName );
}

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 21, 2007 06:28 AM UTC

perfect!!!!! thanks very much

>Hi Boris,

You can control the appearance of the grid line border using the IsGridLinesVisible property of the WorkSheet. If you want to hide the gridLines in a Excel then add the sheet.IsGridLinesVisible = false; statement in a GridToExcel method of the GridExcelConverterControl(150th line of the GridExcelConverterControl.cs file). Here is a modified code of the ExportChart sample.

public void GridToExcel( GridModel grid, string fileName, ConverterOptions options )
{
ExcelEngine engine = CreateEngine();
IWorkbook book = engine.Excel.Workbooks.Create( 1 );
IWorksheet sheet = book.Worksheets[ 0 ];

sheet.IsGridLinesVisible = false; ////Line Number 150..
GridToExcel( grid, sheet, options );

book.Close( true, fileName );
}

Best regards,
Haneef

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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;