Home Forums WinForms controls Xceed Grid for WinForms Grid Link Cell

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16372 |

    Hi

    I am using Xceed Grid for .Net. One of the columns in my grid is a link.

    I have enabled this using 

    Dim lnk As New LinkLabel
                lnk.LinkBehavior = LinkBehavior.AlwaysUnderline
                lnk.LinkVisited = False
                lnk.LinkColor = Color.Blue
                lnk.VisitedLinkColor = Color.Blue
                lnk.UseCompatibleTextRendering = True
                lnk.TextAlign = ContentAlignment.MiddleRight
                lnk.ForeColor = Color.Blue

     .Columns(“ContactCount”).CellViewer = New ControlViewer(lnk, “Text”)

    if the  “ContactCount” > 0 then I want to display the link and ContactCount=0 then

    I want to hide the Link and want to display as normal value.

     

    currently, link is displayed on all the cells. how can I hide the link (if ContactCount=0)?

     

     

     

     

     

     

    Imported from legacy forums. Posted by Tharaka (had 733 views)

    Xceed Support
    Member
    Post count: 5658

    To hide a Link and to display it as normal value if the value is 0, you have to derive from CellViewerManager, and
    override “PaintCellForeground”.  In PaintCellForeground check to see if
    the cell is 0, and if it is the case, return without calling base. 
    Otherwise call the base method.

    Imported from legacy forums. Posted by Mohamed [Xceed] (had 1014 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.