This documentation is archived and is not being maintained.

DataGridView.SelectionChanged Event

Note: This event is new in the .NET Framework version 2.0.

Occurs when the current selection changes.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public event EventHandler SelectionChanged
/** @event */
public void add_SelectionChanged (EventHandler value)

/** @event */
public void remove_SelectionChanged (EventHandler value)

JScript supports the use of events, but not the declaration of new ones.

This event occurs whenever cells are selected or the selection is canceled, whether programmatically or by user action. For example, this event is useful when you want display the sum of the currently selected cells.

When you change the value of the CurrentCell property, the SelectionChanged event occurs before the CurrentCellChanged event. Any SelectionChanged event handler accessing the CurrentCell property at this time will get its previous value.

For more information about handling events, see Consuming Events.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: