Hello!
I am trying to export the content in my UltraWinGrid but I have some problem with the cell borders.
At first, all of the excel cells that as exported from the grid ended up without borders. I then found a property
called WorkSheetCellFormat of the excel cell. So in the CellExported event of the UltraGridExcelExporter, i changed the formatting to exclude BorderFormatting.
That helped a lot but I still have some rows left that doesn't have borders.
Does anyone now how to fix these?
Private Sub ugExcelExport_CellExported(sender As Object, e As Infragistics.Win.UltraWinGrid.ExcelExport.CellExportedEventArgs)
Try
e.CurrentWorksheet.Rows(e.CurrentRowIndex).Cells(e.CurrentColumnIndex).CellFormat.FormatOptions =
WorksheetCellFormatOptions.ApplyAlignmentFormatting + WorksheetCellFormatOptions.ApplyFontFormatting + WorksheetCellFormatOptions.ApplyNumberFormatting
Catch ex As Exception
End Try
End Sub
Yes, it works like you mentioned. It was good that you highlighted that fact to me, since I could change the font color of the header texts in the same procedure. Have completely missed thas those weren't visible ;-)
Thanks!
Hi Henrik,
I believe I have figured out how you can solve this. The reason that some of the cells in the exported worksheet are exporting without borders are because these cells have no borders on the grid. For the data cells, you have handled this in the CellExported event by excluding the ApplyBorderFormatting option from the FormatOptions property of those cells. However, this event does not handle the HeaderCells. In order to get borders to appear for these cells in the exported document, you can handle the HeaderCellExported event and write code similar to the code in your CellExported handler.
Please try this out and let me know if it solves the issue.
I downloaded and ran your sample, and I can see that the borders are not there. I will look into this more and let you know what I find.
Sorry for my late reply Mike!
Here comes an example code, not exactly according to my case but it shows the same problem.
Some cells in the export doesn't get borders.
I hope you can help me out here...
/Henrik
Hi Zlatan,
Are you able to provide a reproduction sample? Please let me know.