asp.net.ph

GridView.SelectedIndexChanging Event

System.Web.UI.WebControls Namespace   GridView Class


.NET Framework version 2.0

Occurs when any of the select buttons in a GridView control is clicked, but before the page changes.

[ VB ]
Public Event SelectedIndexChanging As GridViewSelectEventHandler

[ C# ]
public event GridViewSelectEventHandler SelectedIndexChanging;

[ C++ ]
public: __event GridViewSelectEventHandler* SelectedIndexChanging;

In [ JScript ], you can handle the events defined by a class, but you cannot define your own.

Remarks

The SelectedIndexChanging event is raised whenever any of the select buttons in a GridView control is clicked, but before the GridView handles the paging operation.

This allows you to provide an event-handling method that performs a custom routine, such as canceling the selection operation, whenever this event occurs.

NOTE: This event is not raised when the SelectedIndex property is set programmatically.

Event Data

The method assigned to handle the event is passed an argument of type GridViewSelectEventArgs object containing data related to this event. The following GridViewSelectEventArgs properties provide information specific to this event.

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled ( Inherited from CancelEventArgs )
NewSelectedIndex Gets the index of the page selected by the user in the page selection element of the GridView control.

See Also

GridView   GridViewSelectEventArgs   GridViewSelectEventHandler Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph