public LinkCell(LinkCell cell) : base(cell) { this.m_acolor = Color.Yellow; this.m_vcolor = Color.Gray; this.m_linkFormat = "{0}"; base.TextFont = new Font("Tahoma", 8f, FontStyle.Underline); base.ForeColor = cell.ForeColor; this.m_acolor = cell.m_acolor; this.m_vcolor = cell.m_vcolor; this.m_linkFormat = cell.m_linkFormat; }
protected virtual void OnLink(LinkCell c, Row r, Point index, int yOffset) { Rectangle rectangle = this.CalculateClientRect(); int width = rectangle.Width; if (this.m_bScrollbarOverlap || ((!this.ShowHeader || (this.HeaderRow.Template != c.Owner)) && (!this.ShowFooter || (this.FooterRow.Template != c.Owner)))) { width -= this.m_vScrollWidth; } LinkEventArgs lea = new LinkEventArgs(r, c, index.X, index.Y, yOffset); if (this.m_doubleBuffered) { this.Redraw(BackBufferManager.GetBackBufferGraphics(rectangle.Width, rectangle.Height)); c.DrawActiveLink(BackBufferManager.GetBackBufferGraphics(rectangle.Width, rectangle.Height), lea, width); } else { using (Graphics graphics = base.CreateGraphics()) { c.DrawActiveLink(graphics, lea, width); } } this.Refresh(); if (this.LinkClick != null) { this.LinkClick(this, lea); } Links.AddLink(lea.Target); this.OnChange(this, GridEventArgsType.Repaint, null); }