Infragistics(R) NetAdvantage(R) Windows Forms
FixedHeaderIndicator Enumeration
Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : FixedHeaderIndicator Enumeration

Enum used for specifying whether the user is allowed to fix and unfix headers.

Syntax

Visual Basic (Declaration) 
Public Enum FixedHeaderIndicator 
   Inherits System.Enum
C# 
public enum FixedHeaderIndicator : System.Enum 

Members

MemberDescription
Button Display a button that allows the user to fix or unfix the header. Button also displays whether the header is fixed or not.
Default Default.
InSwapDropDownDisplays a [Fix Header] or [Unfix Header] item in the swap drop down depending on whether the header is currently fixed.
None Don't allow the user to fix or unfix the header.

Example

Following code turns on the fixed header functionality on and also shows some of the properties related to functionality.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' Turn on the fixed headers functionality. This will case the row selectors to
        ' be fixed.
        e.Layout.UseFixedHeaders = True

        ' Fix the second column. This will cause this column to be moved before any
        ' non-fixed columns.
        e.Layout.Bands(0).Columns(1).Header.Fixed = True

        ' Different bands could have different number of fixed columns.
        If e.Layout.Bands.Count > 1 Then
            e.Layout.Bands(1).Columns(0).Header.Fixed = True
            e.Layout.Bands(1).Columns(1).Header.Fixed = True
        End If

        ' Set the appearance of fixed headers.
        e.Layout.Override.FixedHeaderAppearance.BackColor = Color.LightYellow
        e.Layout.Override.FixedHeaderAppearance.ForeColor = Color.Blue

        ' Set the appearance of cells associated witht any fixed headers.
        e.Layout.Override.FixedCellAppearance.BackColor = Color.LightYellow
        e.Layout.Override.FixedCellAppearance.ForeColor = Color.Blue

        ' Set the color of the separator line the separates the fixed cells
        ' from non-fixed cells.
        e.Layout.Override.FixedCellSeparatorColor = Color.Red

        ' Set the type of ui that should be presented to the user for fixing and
        ' unfixing columns. Button displays a fixed header indicator button which
        ' when clicked upon will toggle the fixed state of the header.
        e.Layout.Override.FixedHeaderIndicator = FixedHeaderIndicator.Button

        ' For band 1 make use of the swap drop down ui. There will be [Fix Header] and
        ' [Unfix Header] items in swap drop down.
        If e.Layout.Bands.Count > 1 Then
            e.Layout.Bands(1).Override.FixedHeaderIndicator = FixedHeaderIndicator.InSwapDropDown
        End If

        ' For band 2 don't allow the user to be able to fix or unfix columns.
        If e.Layout.Bands.Count > 2 Then
            e.Layout.Bands(2).Override.FixedHeaderIndicator = FixedHeaderIndicator.None
        End If
    End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Turn on the fixed headers functionality. This will case the row selectors to
			// be fixed.
			e.Layout.UseFixedHeaders = true;

			// Fix the second column. This will cause this column to be moved before any
			// non-fixed columns.
			e.Layout.Bands[0].Columns[1].Header.Fixed = true;

			// Different bands could have different number of fixed columns.
			if ( e.Layout.Bands.Count > 1 )
			{
				e.Layout.Bands[1].Columns[0].Header.Fixed = true;
				e.Layout.Bands[1].Columns[1].Header.Fixed = true;
			}

			// Set the appearance of fixed headers.
			e.Layout.Override.FixedHeaderAppearance.BackColor = Color.LightYellow;
			e.Layout.Override.FixedHeaderAppearance.ForeColor = Color.Blue;

			// Set the appearance of cells associated witht any fixed headers.
			e.Layout.Override.FixedCellAppearance.BackColor = Color.LightYellow;
			e.Layout.Override.FixedCellAppearance.ForeColor = Color.Blue;

			// Set the color of the separator line the separates the fixed cells
			// from non-fixed cells.
			e.Layout.Override.FixedCellSeparatorColor = Color.Red;

			// Set the type of ui that should be presented to the user for fixing and
			// unfixing columns. Button displays a fixed header indicator button which
			// when clicked upon will toggle the fixed state of the header.
			e.Layout.Override.FixedHeaderIndicator = FixedHeaderIndicator.Button;

			// For band 1 make use of the swap drop down ui. There will be [Fix Header] and
			// [Unfix Header] items in swap drop down.
			if ( e.Layout.Bands.Count > 1 )
				e.Layout.Bands[1].Override.FixedHeaderIndicator = FixedHeaderIndicator.InSwapDropDown;

			// For band 2 don't allow the user to be able to fix or unfix columns.
			if ( e.Layout.Bands.Count > 2 )
				e.Layout.Bands[2].Override.FixedHeaderIndicator = FixedHeaderIndicator.None;
		}

Remarks

The FixedHeaderIndicator enum is used for specifying Override's UltraGridOverride.FixedHeaderIndicator and Header's HeaderBase.FixedHeaderIndicator properties.

See Also