DataGrid::DataSourceChanged Event
.NET Framework (current version)
Occurs when the DataSource property value has changed.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The DataSourceChanged event occurs when the DataMember value changes, or when the BindingContext of the DataGrid changes.
The following code example demonstrates the use of this member.
private: System::Windows::Forms::DataGrid^ dataGrid1; void CreateDataGrid() { dataGrid1 = gcnew DataGrid; // Add the handler for the DataSourceChanged event. dataGrid1->DataSourceChanged += gcnew EventHandler( this, &Form1::DataGrid1_DataSourceChanged ); } void DataGrid1_DataSourceChanged( Object^ sender, EventArgs^ /*e*/ ) { DataGrid^ thisGrid = dynamic_cast<DataGrid^>(sender); }
.NET Framework
Available since 1.1
Available since 1.1
Show: