System.Windows.Forms.BindingSource.OnListChanged(System.ComponentModel.ListChangedEventArgs)

Here are the examples of the csharp api class System.Windows.Forms.BindingSource.OnListChanged(System.ComponentModel.ListChangedEventArgs) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: SQLMonitor
Source File: DataGridViewGroup.cs
View license
protected override void OnListChanged(ListChangedEventArgs e)
        {
            if (suspendlistchange) return;


            switch (e.ListChangedType)
            {
                case ListChangedType.ItemChanged:
                    if (groupon != null && groupon.IsProperty(e.PropertyDescriptor))
                        ResetGroup();
                    break;
                case ListChangedType.ItemAdded:
                    if (info != null)
                        info.Rows.Add(List[e.NewIndex]);
                    break;
                case ListChangedType.ItemDeleted:
                    ResetGroup();
                    break;
                case ListChangedType.Reset:
                    ResetGroup();
                    break;
                case ListChangedType.PropertyDescriptorAdded:
                case ListChangedType.PropertyDescriptorChanged:
                case ListChangedType.PropertyDescriptorDeleted:
                    props = null;
                    break;
            }
            base.OnListChanged(e);
        }

2. Example

Project: SQLMonitor
Source File: DataGridViewGroup.cs
View license
public override void RemoveAt(int index)
        {
            if (info == null || groupon == null)
                base.RemoveAt(index);
            else if (!IsGroupRow(index))
            {
                var i = List.IndexOf(this[index]);
                suspendlistchange = true;
                try
                {
                    info.Rows.RemoveAt(index);
                    List.RemoveAt(i);
                    base.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
                }
                finally
                {
                    suspendlistchange = false;
                }
            }
        }