protected internal override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); if (m_Grid.m_RepositioningColumn != null || m_Grid.m_ResizingColumn != null) { return; } var comment = m_Column.GetCommentFromRow(m_Row); if (!string.IsNullOrEmpty(comment)) { var elm = m_Grid.m_CommentElement; if (elm == null) { elm = new CommentElement(m_Host as CellView); m_Grid.m_CommentElement = elm; } var reg = Region; var w = (int)(comment.Length * 8 * m_Host.Zoom); reg.Width = 50 + (w % 350); reg.Height = 15 + (15 * (w / reg.Width)) + 4; if (reg.Right + reg.Width > m_Host.Width / m_Host.Zoom) { reg.X += -reg.Width + 2; } else { reg.X += Region.Width + 2; } if (reg.Bottom + reg.Height > m_Host.Height / m_Host.Zoom) { reg.Y += -reg.Height + 2; } else { reg.Y += Region.Height + 2; } elm.Region = reg; elm.ZOrder = 10; elm.Text = comment; elm.Visible = true; } }
private void rebuildAllCells(bool force)//true to force rebuild inspite of Begin/End Change { if (!force && m_BatchChangeCounter > 0) { m_BatchChangeNeedsRebuild = true; return; } try { if (m_CellView == null) { return; } if (m_Disposed) { return; } //forget all previously selected cells m_SelectedCell = null; m_CommentElement = null; m_CellView.DeleteAllElements(); buildCells(); } finally { if (!force) { m_BatchChangeNeedsRebuild = false; } } }