We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GGC and link label custom cell type

I have taken the link label custom cell type example and modified it for my use. However, in nested tables the style (text color) of the link will not change for the mouse over and mouse out events even though the code is being executed. Any ideas?

4 Replies

BC Brian Corley February 3, 2006 02:14 PM UTC

The code below is not called when the user mouses over any nested table link label cell. The top level table works as expected. protected override void OnDraw(System.Drawing.Graphics g, System.Drawing.Rectangle clientRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style) { style.Font.Underline = true; if(_drawHotLink) { style.TextColor = ActiveLinkColor; } base.OnDraw(g, clientRectangle, rowIndex, colIndex, style); }


ST stanleyj Syncfusion Team February 3, 2006 02:50 PM UTC

Hi Brian, We could see the issue, will get back to you with solution. Thanks, Stanley


AD Administrator Syncfusion Team February 3, 2006 05:38 PM UTC

Hi Brian, LinkLabel cell is not compatible with the NestedTables. Please change the CellRenderer''s DrawLink method as follows to fix the issue: private void DrawLink(bool useHotColor, int rowIndex, int colIndex) { if(useHotColor) _drawHotLink = true; this.Grid.InvalidateRange(GridRangeInfo.Cell(rowIndex, colIndex), GridRangeOptions.None); this.Grid.GetGridWindow().Update(); _drawHotLink = false; } Also we noticed an issue with the current implementation. If you hover over the cell and ''ALT+TAB'' to switch to a new window and again back to the Grid, you could see all linklabel cells are highlighted. You can avoid it by setting the drawHotLink flag to false and refreshing the Grid. public LinkLabelCellRenderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel) { this.Grid.GotFocus += new EventHandler(Grid_GotFocus); .. .. } private void Grid_GotFocus(object sender, EventArgs e) { this._drawHotLink = false; this.Grid.Refresh(); } We will also update the shipping sample. Best regards, Jay


BC Brian Corley February 6, 2006 03:05 PM UTC

works like a champ, thansk, for the help.

Loader.
Live Chat Icon For mobile
Up arrow icon