ディスプレイと印刷のために異なるレイアウトを適用したい場合があるので、このプロパティは印刷目的で使用されるレイアウトを示します。IsDisplayLayout を使用して、レイアウトがディスプレイで使用されるかどうかを決定します。
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Imports System.Diagnostics Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ultraGrid1.InitializeLayout ' Following code writes out which kind of layout is being initialized. A Layout can be ' either a print layout or a display layout. Print layout is the UltraGridLayout object ' that's used when printing. Display layout is the regular UltraGridLayout that's used ' for drawing on the screen. If e.Layout.IsDisplayLayout Then Debug.WriteLine("The UltraGridLayout being initialized is a display layout.") ' Use background color of gray for the grid. e.Layout.Appearance.BackColor = Color.Gray ElseIf e.Layout.IsPrintLayout Then Debug.WriteLine("The UltraGridLayout being initialized is a print layout.") ' Use background color of white when printing. e.Layout.Appearance.BackColor = Color.White End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Following code writes out which kind of layout is being initialized. A Layout can be // either a print layout or a display layout. Print layout is the UltraGridLayout object // that's used when printing. Display layout is the regular UltraGridLayout that's used // for drawing on the screen. if ( e.Layout.IsDisplayLayout ) { Debug.WriteLine( "The UltraGridLayout being initialized is a display layout." ); // Use background color of gray for the grid. e.Layout.Appearance.BackColor = Color.Gray; } else if ( e.Layout.IsPrintLayout ) { Debug.WriteLine( "The UltraGridLayout being initialized is a print layout." ); // Use background color of white when printing. e.Layout.Appearance.BackColor = Color.White; } }