Welcome to the Xceed Community | Help
Community Search  

Grid Link Cell

Sort Posts: Previous Next
  •  08-15-2008, 4:49 AM Post no. 14089

    Grid Link Cell

    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)?

     

     

     

     

     

     

  •  08-26-2008, 3:17 PM Post no. 14519 in reply to 14089

    Re: Grid Link Cell

    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.

    Xceed - Software Developer and Technical Support
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.