Version

Appearance Property (UltraListViewGroup)

Gets/sets the appearance for this UltraListViewGroup.
Syntax
'Declaration
 
Public Property Appearance As Infragistics.Win.AppearanceBase
public Infragistics.Win.AppearanceBase Appearance {get; set;}
Remarks

The appearance properties which apply to the background are applied to the group's header and the group's item area, with the exception of the image background properties, which is only applied to the item area. The appearance properties which control coloring and formatting for text, as well as the image properties, apply only to the group's header area.

Example
The following code sample demonstrates how to handle the UltraListView's ItemActivating and ItemActivated events to change the color of a group's text when an item in that group becomes active:

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_ItemActivating(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinListView.ItemActivatingEventArgs) Handles ultraListView1.ItemActivating
        Dim listView As UltraListView = CType(sender, UltraListView)
        Dim oldActiveItem As UltraListViewItem = listView.ActiveItem
        Dim newActiveItem As UltraListViewItem = e.Item

        '	If the item that is about to be activated belongs to
        '	a different group than the last active item, reset
        '	the last active group's appearance
        If Not oldActiveItem Is Nothing AndAlso _
          Not oldActiveItem.Group Is Nothing AndAlso _
          Not newActiveItem.Group Is Nothing AndAlso _
            Not oldActiveItem.Group Is newActiveItem.Group Then
            oldActiveItem.Group.ResetAppearance()
        End If

    End Sub

    Private Sub ultraListView1_ItemActivated(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinListView.ItemActivatedEventArgs) Handles ultraListView1.ItemActivated
        '    Set the ForeColor of the new ActiveItem's Group's Appearance to red.
        If Not e.Item.Group Is Nothing Then e.Item.Group.Appearance.ForeColor = Color.Red

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

		private void ultraListView1_ItemActivated(object sender, Infragistics.Win.UltraWinListView.ItemActivatedEventArgs e)
		{
			//	Set the ForeColor of the new ActiveItem's Group's Appearance to red.
			if ( e.Item.Group != null )
				e.Item.Group.Appearance.ForeColor = Color.Red;
		}

		private void ultraListView1_ItemActivating(object sender, Infragistics.Win.UltraWinListView.ItemActivatingEventArgs e)
		{
			UltraListView listView = sender as UltraListView;
			UltraListViewItem oldActiveItem = listView.ActiveItem;
			UltraListViewItem newActiveItem = e.Item;

			//	If the item that is about to be activated belongs to
			//	a different group than the last active item, reset
			//	the last active group's appearance
			if ( oldActiveItem != null &&
				 oldActiveItem.Group != null &&
				 newActiveItem.Group != null &&
				 oldActiveItem.Group != newActiveItem.Group )
				oldActiveItem.Group.ResetAppearance();		
		}
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