private void OnSourceListPropertyDescriptorAdded(ListChangedEventArgs e)
        {
            _pdc = ListUtil.GetItemProperties(SourceList);
            int field       = _pdc.IndexOf(e.PropertyDescriptor);
            int columnIndex = field + 1;

            Model.InsertColumns(columnIndex, 1);
            BlinkQueueInsertField(field, null);
            //InsertDirtyCellColumns(columnIndex, 1, null);
            InsertTotalField(field, 1);
            InvalidateVisual(true);
        }
        private void OnSourceListPropertyDescriptorDeleted(ListChangedEventArgs e)
        {
            int field = _pdc.IndexOf(e.PropertyDescriptor);

            _pdc = ListUtil.GetItemProperties(SourceList);
            int columnIndex = field + 1;

            Model.RemoveColumns(columnIndex, 1);
            BlinkQueueDeleteField(field, null);
            //RemoveDirtyCellColumns(columnIndex, 1, null);
            RemoveTotalField(field, 1);
            InvalidateVisual(true);
        }
        private void OnSourceListPropertyDescriptorChanged(ListChangedEventArgs e)
        {
            _pdc = ListUtil.GetItemProperties(SourceList);
            int field       = _pdc.IndexOf(e.PropertyDescriptor);
            int columnIndex = field + 1;

            InvalidateCell(GridRangeInfo.Col(columnIndex));
            InvalidateCell(new RowColumnIndex(SourceList.Count + 1, columnIndex));
            if (IsColumnVisible(columnIndex))
            {
                InvalidateVisual(false);
            }
        }
        protected virtual void WireSourceList()
        {
            System.Windows.Interop.ComponentDispatcher.ThreadIdle += new EventHandler(ComponentDispatcher_ThreadIdle);
            SourceList.ListChanged += new ListChangedEventHandler(SourceList_ListChanged);

            Model.RowCount = SourceList.Count + 1 + FooterRows;

            _pdc = ListUtil.GetItemProperties(SourceList);
            Model.ColumnCount = _pdc.Count + 1;

            // Check if it is a DataTable.
            _dt = GetDataTable(this.SourceList);
            WireDataTable(_dt);

            this._dataSourceRaisesTwoItemAddedEvents = _dt != null;
            InvalidateArrange();
        }