Description プロパティは、行の AutoPreview 領域に表示されるテキストを決定します。バンドの AutoPreviewField プロパティが有効なフィールドまたは列名に設定されている場合、このプロパティは読み取り専用になります。
次のサンプルコードは UltraGrid.InitializeLayout イベントで行のプレビューを有効にし、UltraGrid.InitializeRow イベントで行の説明テキストを設定します。
C#:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Enable the row previews. // this.ultraGrid1.DisplayLayout.Bands[0].AutoPreviewEnabled = true; } private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { Infragistics.Win.UltraWinGrid.UltraGridBand band; band = this.ultraGrid1.DisplayLayout.Bands[0]; // Check for the row being from the same band. // if ( e.Row.Band == band ) { // Create a custom description that we want shown in the row's // row preview area. // System.Text.StringBuilder description = new System.Text.StringBuilder( ); description.Append( e.Row.GetCellText( band.Columns["ContactName"] ) ); description.Append( "\n" ); description.Append( e.Row.GetCellText( band.Columns["City"] ) ); description.Append( ", " ); description.Append( e.Row.GetCellText( band.Columns["Country"] ) ); // Set the row's Description to our custom description text. // e.Row.Description = description.ToString( ); } }