| Infragistics.WebUI.UltraWebGrid Namespace > UltraGridColumn Class : Format Property |
A string used to control the formatting of displayed text.
[Visual Basic]
Public Property Format As String[C#]
public string Format {get; set;}The Format property is similar to the Format function, and supports all of the named arguments and literal strings supported by that function.
The Format property applies only to cells that are not in edit mode.
This event is fired when the grid is begin initialized. It gives us the ability to apply formatting to columns.
For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.
[Visual Basic]
'----------------------------------------------------------------
' Private Sub UltraWebGrid1_InitializeLayout:
' This event is fired when the grid is begin initialized. It
' gives us the ability to apply formatting to columns.
'----------------------------------------------------------------
Private Sub UltraWebGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.WebUI.UltraWebGrid.LayoutEventArgs) Handles Ultrawebgrid1.InitializeLayout
If IsPostBack Then Exit Sub
Ultrawebgrid1.DisplayLayout.TableLayout = Infragistics.WebUI.UltraWebGrid.TableLayout.Fixed
With e.Layout.Bands(0).Columns.FromKey(ExpenseReportData.EXPENSE_REPORT_ID_FIELD)
.Width = Ultrawebgrid1.Width.Pixel(100)
.HeaderText = "Report ID"
End With
With e.Layout.Bands(0).Columns.FromKey(ExpenseReportData.PROJECT_FIELD)
.Width = Ultrawebgrid1.Width.Pixel(325)
.HeaderText = "Project"
.FooterText = "Count:"
.FooterTotal = Infragistics.WebUI.UltraWebGrid.SummaryInfo.Count
.FooterStyle.HorizontalAlign = HorizontalAlign.Left
.FooterStyle.Padding.Left = New Unit(6)
End With
With e.Layout.Bands(0).Columns.FromKey(ExpenseReportData.APRPOVAL_STATUS_FIELD)
.Width = Ultrawebgrid1.Width.Pixel(100)
.HeaderText = "Status"
End With
With e.Layout.Bands(0).Columns.FromKey(ExpenseReportData.CREATE_DATE_FIELD)
.Width = Ultrawebgrid1.Width.Pixel(150)
.Format = "MMMM dd, yyyy"
.HeaderText = "Create Date"
End With
With e.Layout.Bands(0).Columns.FromKey(ExpenseReportData.AMOUNT_FIELD)
.Width = Ultrawebgrid1.Width.Pixel(125)
.FooterText = "Total:"
.FooterTotal = Infragistics.WebUI.UltraWebGrid.SummaryInfo.Sum
.FooterStyle.HorizontalAlign = HorizontalAlign.Right
.FooterStyle.Padding.Left = New Unit(6)
.Format = "$###,###.00"
.CellStyle.HorizontalAlign = HorizontalAlign.Right
End With
End Sub