See Also

UltraWebGrid Class  | UltraWebGrid Members

Language

Visual Basic

C#

Show All

See Also Languages Infragistics2.WebUI.UltraWebGrid.v7.2

DisplayLayout Property

Infragistics.WebUI.UltraWebGrid Namespace > UltraWebGrid Class : DisplayLayout Property

Returns a reference to or sets the UltraGridLayout object for the grid.

[Visual Basic]
Public ReadOnly Property DisplayLayout As UltraGridLayout
[C#]
public UltraGridLayout DisplayLayout {get;}

Remarks

The UltraGridLayout object is the primary means of controlling layout and display information for the grid.

In CLR2 builds of the control this property is ReadOnly in order to better support themeing. If this property was being set, the code in question will now have to reset the existing layout object and set the changes to initial object.

Example

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

See Also

UltraWebGrid Class  | UltraWebGrid Members

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 1996-2007 Infragistics, Inc. All rights reserved.

Build Version: 7.2.20072.1063