Addhyperlink to gridcell

Hi,

How do we create a hyperlink in a cell? Previously in our project we had webcells and used
sheet.Hyperlinks.AddHyperlink(CellPos).
From this thread I learnt that Gridcells are the newer API. Does it support this same functionality?

Hi Abhishek,


Thank you for contacting Aspose support.

You should be using the GridHyperlinkCollection.Add method with latest API set in order to inject a hyperlink to a cell. Please check the following piece of code for your reference.

C#

var sheet = this.GridWeb1.WorkSheets[this.GridWeb1.ActiveSheetIndex];
sheet.Hyperlinks.Add(“A1”, “http://www.google.com”);

Thanks for the reply.

Proceeding on the above question, how do I then access Hyperlink properties such as Text, ToolTip, CellCommand, ActionType?

Hi again,


Thank you for writing back.

Please note that the GridHyperlinkCollection.Add method returns the index of the newly added Hyperlink. You can use this index to get the instance of newly added Hyperlink and manipulate the properties such as ScreenTip, TextToDisplay, Command and so on.