private void CellPaintEventHandler(object sender, object e)
 {
     try
     {
         int lRowNumber = (int)(long)e.GetType().InvokeMember("RowNumber", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public, null, e, null);
         Microsoft.SqlServer.Management.UI.Grid.GridColumn oCol = (Microsoft.SqlServer.Management.UI.Grid.GridColumn)e.GetType().InvokeMember("GridColumn", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public, null, e, null);
         int iColumnIndex = oCol.ColumnIndex;
         Microsoft.SqlServer.Management.UI.Grid.DlgGridControl grid2 = (Microsoft.SqlServer.Management.UI.Grid.DlgGridControl)sender;
         Microsoft.SqlServer.Management.UI.Grid.GridCell       cell  = grid2.GetCellInfo(lRowNumber, iColumnIndex);
         TriStatePerspectiveGridCell cell2 = cell as TriStatePerspectiveGridCell;
         if (cell2 != null && cell2.OverrideBkBrush != null)
         {
             int iSelectedRow = 0;
             int iSelectedCol = 0;
             grid2.GetSelectedCell(out iSelectedRow, out iSelectedCol);
             if (iSelectedCol == iColumnIndex && iSelectedRow == lRowNumber && cell2.OverrideBkBrush.Color != System.Drawing.Color.Red)
             {
                 return; //to avoid this selected cell looking funny when it's not highlighted but selected
             }
             System.Drawing.Graphics  g    = (System.Drawing.Graphics)e.GetType().InvokeMember("Graphics", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public, null, e, null);
             System.Drawing.Rectangle rect = (System.Drawing.Rectangle)e.GetType().InvokeMember("CellRectangle", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public, null, e, null);
             rect.X      += 1;
             rect.Y      += 2;
             rect.Width  -= 2;
             rect.Height -= 3;
             g.DrawRectangle(new System.Drawing.Pen(cell2.OverrideBkBrush.Color, (float)2), rect);
         }
     }
     catch { }
 }
 public TriStatePerspectiveGridCell(Microsoft.SqlServer.Management.UI.Grid.GridCell original) : base(string.Empty)
 {
     _original = original;
     base.Assign(original);
 }
 public TriStatePerspectiveGridCell(Microsoft.SqlServer.Management.UI.Grid.GridCell original) : base(string.Empty)
 {
     _original = original;
     base.Assign(original);
 }