Click or drag to resize

PageDataGridDataItemClassOnCollectionChanged Method

Data items changed handling

Namespace:  SOWIWin.Helper
Assembly:  SOWIWin.Helper (in SOWIWin.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
protected virtual void OnCollectionChanged(
	Object sender,
	NotifyCollectionChangedEventArgs e
)

Parameters

sender
Type: SystemObject

[Missing <param name="sender"/> documentation for "M:SOWIWin.Helper.PageDataGrid`1.OnCollectionChanged(System.Object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)"]

e
Type: System.Collections.SpecializedNotifyCollectionChangedEventArgs

[Missing <param name="e"/> documentation for "M:SOWIWin.Helper.PageDataGrid`1.OnCollectionChanged(System.Object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)"]

Examples
Data handling when data item remove
private void DataGridView_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
    if (e.Action == NotifyCollectionChangedAction.Remove)
    {
        var lListRemove = e.OldItems;
        SOWIData.Management.DataGrid lItem;
        foreach (var item in lListRemove)
        {
            lItem = (SOWIData.Management.DataGrid)item;
            if (lItem.ID > 0)
            {
                AppDataGrid.Delete(lItem.ID);
            }
        }
    }
}
See Also