Databinding and HyperLink cell type

Posted by: sassanow on 8 September 2017, 2:18 pm EST

  • Posted 8 September 2017, 2:18 pm EST

    I need to be able to data bind to the NavigationUrl property as well as the Text that is displayed in a hyperlink cell type.  Is this possible?


    Example the cell text may say DocumentA but the NavigationURL would be http://www.mydomain.com/documents/documentA.pdf


     

  • Replied 8 September 2017, 2:18 pm EST

    Hello,

    NavigateUrl is the property of HyperLinkCellType in Spread for Asp.Net. And Spread for Win have Link property in HyperLinkCellType. However, you need to use the Text and Link property of the HyperLinkCellType to display the desired text and navigate to a link. Code for Spread Win and Spread for Web is given below to achieve the desired behaviour.

            FarPoint.Win.Spread.CellType.HyperLinkCellType hlnkcell = new FarPoint.Win.Spread.CellType.HyperLinkCellType();
            hlnkcell.Text = "DocumentA ";
            hlnkcell.Link = "http://www.mydomain.com/documents/documentA.pdf";
            fpSpread1.ActiveSheet.Cells[1, 1].CellType = hlnkcell;

    Or

            FarPoint.Web.Spread.HyperLinkCellType hlcell = new FarPoint.Web.Spread.HyperLinkCellType("http://www.mydomain.com/documents/documentA.pdf", "");
            FpSpread1.ActiveSheetView.Cells[1, 1].CellType = hlcell;
            FpSpread1.ActiveSheetView.Cells[1, 1].Value = "DocumentA";
    Thanks.


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels