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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

turn on column header borders

Thread ID:

Created:

Updated:

Platform:

Replies:

63955 Jul 11,2007 10:52 PM UTC Jul 12,2007 09:22 PM UTC WinForms 4
loading
Tags: GridControl
John
Asked On July 11, 2007 10:52 PM UTC


Hi,

Is there a way to set the column header borders so that they show up when exporting to excel?

haneefm [Syncfusion]
Replied On July 11, 2007 11:02 PM UTC

Hi Code12345,

If you want to affect the column/row headers, handle the Model’s QueryCellInfo event, and set the appropriate style when row zero or column zero is requested.

private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if( e.RowIndex == 0 )
{
e.Style.Borders.All = new GridBorder(GridBorderStyle.Solid);
}
}

Best regards,
Haneef

John
Replied On July 11, 2007 11:18 PM UTC


Hi Haneef,

Thanks for the input. =) I think I might just try to turn on the column header borders all the time. Could you provide an example of how to do this? Thanks!

haneefm [Syncfusion]
Replied On July 12, 2007 07:37 PM UTC

Hi code12345,

You can conditionally turn ON the border by enable flag before call the GridToExcelExport method and disable it after GridToExcelExport method. You can try the code:

private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if( IsExcelExport && e.RowIndex == 0 )
{
e.Style.Borders.All = new GridBorder(GridBorderStyle.Solid);
}
}

Best regards,
Haneef

John
Replied On July 12, 2007 09:22 PM UTC


Hi Haneef,

I would like to keep the column header borders on all the time and not just for exporting into excel. What property of the databoundgrid do I need to modify in order to accomplish this? Thanks!


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.

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

;