'Declaration Public Event InitializeColumn As InitializeColumnEventHandler
public event InitializeColumnEventHandler InitializeColumn
The event handler receives an argument of type InitializeColumnEventArgs containing data related to this event. The following InitializeColumnEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Column | Ultra grid column. |
ExcelFormatStr | Excel specific format string. |
FrameworkFormatStr | Format string used in .NET Framework. |
The FrameworkFormatStr argument has value only if column has format string assigned. Value represents format string in .NET Framework format.
If needed, the ExcelFormatStr argument should be set to excel specific format string. If not set, cells in column will have no specific format.
This event is fired when a grid column is initialized. You should use this event to convert format strings from .NET Framework format to Excel format. See .NET Framework documentation and Excel help file for more information about differences in format strings.
Private Sub MyGridExporter_InitializeColumn(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.InitializeColumnEventArgs) Handles MyGridExporter.InitializeColumn Select Case e.FrameworkFormatStr Case "##.##" e.ExcelFormatStr = "[<>0]##.##;[=0]\" \ ";" Case "hh:mm:ss" e.ExcelFormatStr = "m.d.yy h:mm;@" Case Else e.ExcelFormatStr = e.FrameworkFormatStr End Select End Sub
private void InitializeColumn_EH(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.InitializeColumnEventArgs e) { switch(e.FrameworkFormatStr) { case "##.##": e.ExcelFormatStr = "[<>0]##.##;[=0]\"\";"; break; case "hh:mm:ss": e.ExcelFormatStr = "m.d.yy h:mm;@"; break; default: e.ExcelFormatStr = e.FrameworkFormatStr; break; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2