Version

View Property

Gets/sets how items are displayed in the control.
Syntax
'Declaration
 
Public Property View As UltraListViewStyle
public UltraListViewStyle View {get; set;}
Remarks

The View property provides a way for the end developer to change the way items are presented to the end user. The following table lists each setting for the View property, along with a brief description:

Value Description
Details Items are displayed in a grid-like fashion; headers are displayed for the MainColumn and each visible member of the SubItemColumns collection, with the item's value being displayed under the MainColumn, and each UltraListViewSubItem value being displayed under the header of the corresponding UltraListViewSubItemColumn.
List Items are displayed as an image, along with the item's UltraListViewItemBase.Text. Items are positioned from top to bottom, wrapping to a new column when the available vertical space is exhausted.

Note: The UltraListView control can emulate a standard .NET ListBox control by setting the MultiColumn property to false when the View property is set to 'List'. Sub-items are not displayed in the 'List' view.
Icons Items are displayed as an image, along with the item's UltraListViewItemBase.Text underneath. The way items are positioned is dependent on the value of the Alignment property. Sub-items are not displayed in the 'Icons' view.
Tiles Items are displayed as an image, along with the item's UltraListViewItemBase.Text to the right of the image. The way items are positioned is dependent on the value of the Alignment property. Sub-item values are displayed underneath the item's value in the 'Tiles' view.
Thumbnails Items are displayed as an image in a large bordered square, along with the item's UltraListViewItemBase.Text underneath. The way items are positioned is dependent on the value of the Alignment property. Sub-item values are not displayed in the 'Thumbnails' view.




Each setting for the View property has a corresponding property, exposed by the UltraListView control, which exposes the properties that apply to that view. For example, properties which apply to the 'Details' view appear under the ViewSettingsDetails property.

Example
The following code sample demonstrates how the UltraListView control's ViewChanged event can be handled to receive a notification when the value of the 'View' property changes, and how this notification can be used to optimize the control's visual appearance for that particular view:

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.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView

    Private Sub ultraListView1_ViewChanged(ByVal sender As System.Object, ByVal e As EventArgs) Handles ultraListView1.ViewChanged
        Dim listView As UltraListView = CType(sender, UltraListView)

        Select Case listView.View
            Case UltraListViewStyle.Details

                listView.ViewSettingsDetails.ImageList = Me.imageList16
                listView.ViewSettingsDetails.ImageSize = New Size(16, 16)
                listView.ItemSettings.DefaultImage = Image.FromFile("Folder16.bmp")

            Case UltraListViewStyle.List

                listView.ViewSettingsList.ImageList = Me.imageList16
                listView.ViewSettingsList.ImageList = Me.imageList16
                listView.ItemSettings.DefaultImage = Image.FromFile("Folder16.bmp")

            Case UltraListViewStyle.Icons

                listView.ViewSettingsIcons.ImageList = Me.imageList32
                listView.ViewSettingsIcons.ImageList = Me.imageList32
                listView.ItemSettings.DefaultImage = Image.FromFile("Folder32.bmp")

            Case UltraListViewStyle.Tiles

                listView.ViewSettingsTiles.ImageList = Me.imageList48
                listView.ViewSettingsTiles.ImageList = Me.imageList48
                listView.ItemSettings.DefaultImage = Image.FromFile("Folder48.bmp")

            Case UltraListViewStyle.Thumbnails

                listView.ViewSettingsThumbnails.ImageList = Me.imageList48
                listView.ViewSettingsThumbnails.ImageList = Me.imageList48
                listView.ItemSettings.DefaultImage = Image.FromFile("Folder48.bmp")

        End Select

    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;

		private void ultraListView1_ViewChanged(object sender, System.EventArgs e)
		{
			UltraListView listView = sender as UltraListView;

			switch( listView.View )
			{
				case UltraListViewStyle.Details:
				{
					listView.ViewSettingsDetails.ImageList = this.imageList16;
					listView.ViewSettingsDetails.ImageSize = new Size( 16, 16 );
					listView.ItemSettings.DefaultImage = Image.FromFile( "Folder16.bmp" );
				}
				break;

				case UltraListViewStyle.List:
				{
					listView.ViewSettingsList.ImageList = this.imageList16;
					listView.ViewSettingsList.ImageList = this.imageList16;
					listView.ItemSettings.DefaultImage = Image.FromFile( "Folder16.bmp" );
				}
				break;

				case UltraListViewStyle.Icons:
				{
					listView.ViewSettingsIcons.ImageList = this.imageList32;
					listView.ViewSettingsIcons.ImageList = this.imageList32;
					listView.ItemSettings.DefaultImage = Image.FromFile( "Folder32.bmp" );
				}
				break;

				case UltraListViewStyle.Tiles:
				{
					listView.ViewSettingsTiles.ImageList = this.imageList48;
					listView.ViewSettingsTiles.ImageList = this.imageList48;
					listView.ItemSettings.DefaultImage = Image.FromFile( "Folder48.bmp" );
				}
				break;

				case UltraListViewStyle.Thumbnails:
				{
					listView.ViewSettingsThumbnails.ImageList = this.imageList48;
					listView.ViewSettingsThumbnails.ImageList = this.imageList48;
					listView.ItemSettings.DefaultImage = Image.FromFile( "Folder48.bmp" );
				}
				break;

			}
		}
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