ZForge.Controls.XPTable.Models.Row.OnCellRemoved C# (CSharp) Method

OnCellRemoved() protected method

Raises the CellRemoved event
protected OnCellRemoved ( RowEventArgs e ) : void
e ZForge.Controls.XPTable.Events.RowEventArgs A RowEventArgs that contains the event data
return void
        protected internal virtual void OnCellRemoved(RowEventArgs e)
        {
            e.SetRowIndex(this.Index);

            if (e.Cell != null)
            {
                if (e.Cell.Row == this)
                {
                    e.Cell.InternalRow = null;
                    e.Cell.InternalIndex = -1;

                    if (e.Cell.Selected)
                    {
                        e.Cell.SetSelected(false);

                        this.InternalSelectedCellCount--;

                        if (this.SelectedCellCount == 0 && this.TableModel != null)
                        {
                            this.TableModel.Selections.RemoveRow(this);
                        }
                    }
                }
            }
            else
            {
                if (e.CellFromIndex == -1 && e.CellToIndex == -1)
                {
                    if (this.SelectedCellCount != 0 && this.TableModel != null)
                    {
                        this.InternalSelectedCellCount = 0;

                        this.TableModel.Selections.RemoveRow(this);
                    }
                }
            }

            this.UpdateCellIndicies(e.CellFromIndex);

            if (this.CanRaiseEvents)
            {
                if (this.TableModel != null)
                {
                    this.TableModel.OnCellRemoved(e);
                }

                if (CellRemoved != null)
                {
                    CellRemoved(this, e);
                }
            }
        }