DataSourceControl::RaiseDataSourceChangedEvent Method (EventArgs^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Raises the DataSourceChanged event.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

virtual void RaiseDataSourceChangedEvent(
	EventArgs^ e


Type: System::EventArgs^

An EventArgs that contains event data.

The RaiseDataSourceChangedEvent method notifies a data-bound control that the underlying data source or the data cached in memory has changed, and that the control should rebind and perform any necessary additional work. Typically, the RaiseDataSourceChangedEvent method is called when a property of the data source control or a parameter value has changed.

Raising an event invokes the event handler through a delegate. For more information, see NIB: Raising an Event.

Notes to Inheritors:

When overriding RaiseDataSourceChangedEvent in a derived class, be sure to call the base class's RaiseDataSourceChangedEvent method so that registered delegates receive the event.

The following code example demonstrates how to call the RaiseDataSourceChangedEvent method when a data source or its underlying data has changed in a way that might affect any bound controls. In this example, a file-based data source control that extends the DataSourceControl class raises the DataSourceChanged event by calling RaiseDataSourceChangedEvent any time the FileName property is changed.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top