Free Support Forum - aspose.com

Error assigning cellcmd hyperlink to large number of columns

Is there a limit on how many columns can be assigned a hyperlink cellcommand? I have a routine that loops through all columns in the gridweb and assigns a cellcommand to each column in the 1st row. Normally it works fine but we don't usually have more than 256 columns. Anything more than that and I get an error:

Specified argument was out of the range of valid values.

Code where it fails is:

agridCell = agridCells[0, c];

m_sAttribute = agridCell.StringValue;

cellcmd = agridResults.WebWorksheets[i].Hyperlinks.AddHyperlink(0, c);

cellcmd.ActionType = HyperlinkActionType.CellCommand;

cellcmd.ToolTip = "Click here to sort";

cellcmd.CellCommand = agridCell.Name;

cellcmd.Text = m_sAttribute;

When I comment out this code block I do not get the error.

Thanks.

Hi,

We have looked through the code and found that this line throws the exception:

cellcmd.CellCommand = agridCell.Name;

Currently the grid doesn't support getting the name of a cell whose column is great than 255. You may use the column number and row number as the cell command for cell column > 255.

And we will fix this issue soon.