Version

AutoPreviewEnabled Property (UltraGridRow)

Returns a value that determines whether the AutoPreview area will be displayed.
Syntax
'Declaration
 
Public ReadOnly Property AutoPreviewEnabled As Boolean
public bool AutoPreviewEnabled {get;}
Remarks

The AutoPreview area appears under a row and provides a way to display multiple lines of text associated with that row. You can specify how many lines of text should be displayed, and choose to either display the value from a cell in the row or a custom text string that you specify. One common use might be to display the contents of a memo field that initially appears off-screen when the grid is loaded.

The AutoPreviewEnabled property determines whether the AutoPreview area can be displayed for rows in the specified band. Once AutoPreview has been enabled, it can be displayed for any row by setting the UltraGridRow object's AutoPreviewHidden property to False.

Example
Following code shows how to hide auto preview for a particular row by setting the AutoPreviewHidden property of that row to true.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button25_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button25.Click

       ' Set the AutoPreviewEnabled to enable row previews.
       Me.ultraGrid1.DisplayLayout.Bands(0).AutoPreviewEnabled = True
       Me.ultraGrid1.DisplayLayout.Bands(0).AutoPreviewField = "Address"

       Dim row1 As UltraGridRow = Me.ultraGrid1.Rows(0)
       Dim row2 As UltraGridRow = Me.ultraGrid1.Rows(1)

       ' You can hide auto preview for a specific row by setting AutoPreviewHidden to true.
       row1.AutoPreviewHidden = True

       ' AutoPreviewEnabled returns whether the auto preview will be shows on the row or not.
       ' Write out for row 0 and row 1 to show how setting AutoPreviewHidden to true effects
       ' the AutoPreviewEnabled.
       Debug.WriteLine("Row 1 AutoPreviewEnabled = " & row1.AutoPreviewEnabled)
       Debug.WriteLine("Row 2 AutoPreviewEnabled = " & row2.AutoPreviewEnabled)

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button25_Click(object sender, System.EventArgs e)
{

	// Set the AutoPreviewEnabled to enable row previews.
	this.ultraGrid1.DisplayLayout.Bands[0].AutoPreviewEnabled = true;
	this.ultraGrid1.DisplayLayout.Bands[0].AutoPreviewField = "Address";

	UltraGridRow row1 = this.ultraGrid1.Rows[0];
	UltraGridRow row2 = this.ultraGrid1.Rows[1];
				 
	// You can hide auto preview for a specific row by setting AutoPreviewHidden to true.
	row1.AutoPreviewHidden = true;

	// AutoPreviewEnabled returns whether the auto preview will be shows on the row or not.
	// Write out for row 0 and row 1 to show how setting AutoPreviewHidden to true effects
	// the AutoPreviewEnabled.
	Debug.WriteLine( "Row 1 AutoPreviewEnabled = " + row1.AutoPreviewEnabled );
	Debug.WriteLine( "Row 2 AutoPreviewEnabled = " + row2.AutoPreviewEnabled );

}
Requirements

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

See Also