Gridcontrol - Export to pdf outline

Hello,

When I export a gridcontrol to pdf the grid don't have outline/contour.

I've try gridTmp.RowStyles[0].Borders.Top but have no effect (header?).

Is there a way to add a border/outline to main grid?

Thanks


4 Replies 1 reply marked as answer

VS Vijayarasan Sivanandham Syncfusion Team September 23, 2022 03:11 PM UTC

Hi Dinis Ferreira,

Currently, we are analyzing your requirement of “How to add a border/outline to grid Export to pdf”. So, we need two more business days to validate this. We will validate and update you the details on or before September 27, 2022.


We appreciate your patience until then.

Regards,
Vijayarasan S



VS Vijayarasan Sivanandham Syncfusion Team September 27, 2022 05:56 PM UTC

Hi Dinis Ferreira,


Your requirement to add a border/outline to grid Export to pdf can be achieved by adding the top and left border for GridControl using QueryCellInfo. Please refer to the below code snippet,

//Event Subscription

gridControl1.QueryCellInfo += OnQueryCellInfo;

 

//Event customization

private void OnQueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

     //here set the Top border for Column Header

     if (e.RowIndex == 0)

         e.Style.Borders.Top = new GridBorder(GridBorderStyle.Solid);

     //here set the Left border for Row Header

     if (e.ColIndex == 0)

         e.Style.Borders.Left = new GridBorder(GridBorderStyle.Solid);

}


KB Link:
https://www.syncfusion.com/kb/418/how-to-change-the-gridcells-border-margins-styles-and-appearance-in-winforms-gridcontrol

https://www.syncfusion.com/kb/9509/how-to-enable-header-cell-borders-if-its-celltype-is-textbox

Regards,
Vijayarasan S

If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Attachment: GridControl_1e2e1093.zip

Marked as answer

DF Dinis Ferreira September 29, 2022 09:21 AM UTC

Hi,

This works very good.

Thanks.



VS Vijayarasan Sivanandham Syncfusion Team September 29, 2022 02:09 PM UTC

Hi Dinis Ferreira,

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.

Regards,
Vijayarasan S


Loader.
Up arrow icon