Aspose.Cells.GridWeb.Examples.CSharp.Cells.AccessCellHyperlink.InitGridWeb C# (CSharp) Method

InitGridWeb() private method

private InitGridWeb ( ) : void
return void
        private void InitGridWeb()
        {
            // Accessing the reference of the worksheet that is currently active
            GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            // Adds a text hyperlink that gos to Aspose site and opens in new window
            int linkIndex = sheet.Hyperlinks.Add("A1", "http://www.aspose.com");
            GridHyperlink link1 = sheet.Hyperlinks[linkIndex];

            link1.Target = "_blank";

            // Setting text of the hyperlink
            link1.TextToDisplay = "Aspose";

            // Setting tool tip of the hyperlink
            link1.ScreenTip = "Open Aspose Web Site in new window";

            // Adding hyperlink to the worksheet to open in parent window
            linkIndex = sheet.Hyperlinks.Add("A2", "http://www.aspose.com/docs/display/cellsnet/Aspose.Cells.GridWeb");
            GridHyperlink link2 = sheet.Hyperlinks[linkIndex];

            link2.Target = "_parent";

            // Setting text of the hyperlink
            link2.TextToDisplay = "Aspose.Grid Docs";

            // Setting tool tip of the hyperlink
            link2.ScreenTip = "Open Aspose.Grid Docs in parent window";
        }