Hallo,
i'm setting column width of my grid during export:
Private Sub m_exporter_GridFieldCaptionExporting(sender As Object, e As Infragistics.Web.UI.GridControls.GridFieldCaptionExportingEventArgs) Handles m_exporter.GridFieldCaptionExporting If (e.GridCell.OwnerField.GetType() Is GetType(TemplateDataField)) Then Dim col As Infragistics.Documents.Excel.WorksheetColumn
col = e.Worksheet.Columns(e.WorksheetCell.ColumnIndex) col.SetWidth(50, Infragistics.Documents.Excel.WorksheetColumnWidthUnit.Pixel) End If End Sub
but it doesn'work. Why?
I'm using version 2011.1 (last release).
Thanks
Got this to work in version 2012.1...
Width is defined as
Public Property Width() As IntegerMember of Infragistics.Documents.Excel.WorksheetColumnSummary:Gets or sets the column width including padding, in 256ths of the '0' digit character width in the workbook's default font.
Protected Sub weeExportGrid_Exported(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.ExcelExportedEventArgs) Handles weeExportGrid.Exported
e.Worksheet.Columns.Item(0).Width = 256 * 7e.Worksheet.Columns.Item(1).Width = 256 * 11
e.Worksheet.Rows(0).Height = 1075
End Sub
A width of 256 * 7 will be approximately 6.29 pixels