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

Specifies how multiple cells are range selected using mouse and keyboard.

Syntax

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

Example

Following code shows how to control cell-selection in the UltraGrid.

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

  Private Sub Button49_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button49.Click

      ' Set the SelectTypeCell to Single so only a single cell can be selected at a
      ' time. Setting it on the layout's Override applies it to the whole grid.
      Me.UltraGrid1.DisplayLayout.Override.SelectTypeCell = SelectType.Single

      ' You can override grid-wide settings (settings on the layout's Override) on a 
      ' particular band by setting the associated properties on that band's Override. 
      ' Following code sets the SelectTypeCell on the band 0 override to allow the user
      ' to select multiple cells in that band.
      Me.UltraGrid1.DisplayLayout.Bands(0).Override.SelectTypeCell = SelectType.Extended

	' Set the MultiCellSelectionMode
   Me.ultraGrid1.DisplayLayout.Bands(0).Override.MultiCellSelectionMode = MultiCellSelectionMode.Snaking


      ' You can set the MaxSelectedCells to limit the number of cells the user can select.
      Me.UltraGrid1.DisplayLayout.Bands(0).Override.MaxSelectedCells = 100

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

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

	// Set the SelectTypeCell to Single so only a single cell can be selected at a
	// time. Setting it on the layout's Override applies it to the whole grid.
	this.ultraGrid1.DisplayLayout.Override.SelectTypeCell = SelectType.Single;

	// You can override grid-wide settings (settings on the layout's Override) on a 
	// particular band by setting the associated properties on that band's Override. 
	// Following code sets the SelectTypeCell on the band 0 override to allow the user
	// to select multiple cells in that band.
	this.ultraGrid1.DisplayLayout.Bands[0].Override.SelectTypeCell = SelectType.Extended;


	// Set the MultiCellSelectionMode
   this.ultraGrid1.DisplayLayout.Bands[0].Override.MultiCellSelectionMode = MultiCellSelectionMode.Snaking;

	// You can set the MaxSelectedCells to limit the number of cells the user can select.
	this.ultraGrid1.DisplayLayout.Bands[0].Override.MaxSelectedCells = 100;

}

Remarks

MultiCellSelectionMode property specifies how multiple cells are range selected.

See Also