Infragistics(R) NetAdvantage(R) Windows Forms
HeaderClickAction Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridOverride Class : HeaderClickAction Property

Returns or sets a value that determines what will occur when the user clicks on a header.

Syntax

Visual Basic (Declaration) 
Public Property HeaderClickAction As HeaderClickAction
C# 
public HeaderClickAction HeaderClickAction {get; set;}

Example

Following code sets the HeaderClickAction on the layout's override and a band's override.

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

  Private Sub Button50_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button50.Click

      ' HeaderClickAction indicates the action that the UltraGrid should take when a column
      ' header is clicked. Select causes the UltraGrid to select the column and SortMulti or
      ' SortSingle causes it to sort the column. Default is SortMulti in OutLookGroupBy 
      ' view style and Select otherwise.

      ' Set the HeaderClickAction on the layout's override. 
      Me.ultraGrid1.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti

      ' You can override that grid-wide setting for a particular band by setting it on the
      ' override of that band.
      Me.ultraGrid1.DisplayLayout.Bands(1).Override.HeaderClickAction = HeaderClickAction.Select

  End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

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

	// HeaderClickAction indicates the action that the UltraGrid should take when a column
	// header is clicked. Select causes the UltraGrid to select the column and SortMulti or
	// SortSingle causes it to sort the column. Default is SortMulti in OutLookGroupBy 
	// view style and Select otherwise.

	// Set the HeaderClickAction on the layout's override. 
	this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	// You can override that grid-wide setting for a particular band by setting it on the
	// override of that band.
	this.ultraGrid1.DisplayLayout.Bands[1].Override.HeaderClickAction = HeaderClickAction.Select;

}

Remarks

Setting HeaderClickAction to enable column sorting disables selection via group headers. Group headers cannot be used for sorting; the HeaderClickAction.SortSingle and HeaderClickAction.SortMulti settings only affect column headers.

When this property is set to HeaderClickAction.SortMulti, the user can use the SHIFT key in combination with the mouse to select multiple columns for sorting. The order in which columns are selected is significant, determining the order in which the data will be sorted.

See Also