Queries about LoadValueList and AddHyperlink

Hi, I am very new to aspose. Currently upgrading a project from Aspose.Grid.Web to Aspose.Cells.GridWeb.


1) sheet.Cells[row, j].Validation.LoadValueList(lc.cv, lc.dv, lc.dc, false);
The above line gives the error ‘Aspose.Cells.GridWeb.Validation’ does not contain a definition for ‘LoadValueList’ and no extension method ‘LoadValueList’ accepting a first argument of type ‘Aspose.Cells.GridWeb.Validation’ could be found (are you missing a using directive or an assembly reference?)


2) Hyperlink cs = sheet.Hyperlinks.AddHyperlink(sheet.Cells[0, column]);
It gives the error “Argument 1: cannot convert from ‘Aspose.Cells.GridWeb.Data.WebCell’ to ‘string’”. sheet is a WebWorksheet and Cells is WebCells.

FYI, both work fine when using Aspose.Grid.Web, it’s just that when using Aspose.Cells.GridWeb they give these errors. Any help would be appreciated.

Hi,


Well, we have re-modeled Aspose.Cells.GridWeb APIs, some relevant new APIs are added and some older APIs are obfuscated. So, you got to change your code snippets in your project in accordance with new APIs set, please see the Aspose.Cells for .NET API Reference CHM docs, especially browse to see newer APIs in Aspose.Cells.GridWeb.Data and Aspose.Cells.GridWeb namespaces.

1) Please try using new GridValidationCollection and GridValidation APIs instead.

2) Please see the sample code below and refer to it for your reference:
e.g
Sample code:

//Accessing the reference of the worksheet that is currently active
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];
//Adding hyperlink to the worksheet
GridHyperlink cs = sheet.Hyperlinks[sheet.Hyperlinks.Add(sheet.Cells[0, 0].Name, “http://www.aspose.com”)];

//Setting text of the hyperlink
cs.TextToDisplay = “Aspose”;

//Setting tool tip of the hyperlink
cs.ScreenTip = “Open Aspose Web Site in new window”;


Hope, this helps a bit.

Thank you.


Hi,


Would it be possible to have some small sample code for implementing the equivalent of LoadValueList to load a DataView using the newer APIs? Currently, my code uses
sheet.Cells[row,j].CreateValidation(Aspose.Cells.GridWeb.ValidationType.FreeList, false);
sheet.Cells[row, j].Validation.LoadValueList(lc.cv, lc.dv,lc.dc, false);

Hi,


Could you provide us working sample (runnable) for older LoadValueList which was working fine with older GridWeb version, we will check and may guide you to update the code segment accordingly with latest version (if possible).

Thank you.
Hi,

Regarding my issue regarding LoadValueList would it possible to work with a snippet of the code? Because I am not familiar with the framework and it's difficult to find documentation for Aspose.Grid.Web it seems. Basically, from my understanding the code seems to be for filling in values for each cell.

ListColumn is simply a class which has below used members (ColumnValue is a DataView, DisplayValue/DisplayColumn are strings as per documentation). "this" refers to a custom control which inherits from GridWeb. The following function is also a member of this custom control.

private void SetListColumns(WebWorksheet sheet)
{
foreach (ListColumn listColumn in this.listColumnCollection)
{
for (int j = 0; j < sheet.Cells.MaxColumn + 1; j++)
{
for (int row = 1; row < this.MaxRow; row++)
{
sheet.Cells[row, j].CreateValidation(ValidationType.FreeList, false);
sheet.Cells[row, j].Validation.LoadValueList(listColumn.ColumnValue, listColumn.DisplayValue,
listColumn.DisplayColumn, false);
}
}
}
}

Hi,


Thanks for providing further details about LoadValueList.

I did evaluate your issue a bit. I observed that LoadValueList API is missing under Aspose.Cells.GridWeb.Validation class in the newer Aspose.Cells.GridWeb control, so we cannot load and set DataView/ List object for the applied data validation in the worksheet. I also tried to use newer GridValidationCollection and GridValidation APIs but they also lack the feature(s).

I have logged a ticket with an id “CELLSNET-43952” for your desired feature/ task. Our product team will check check if we could provide you code snippet with the newer APIs set to accomplish the task or we may incorporate the missing APIs to the Aspose.Cells.GridWeb control as these APIs are there in older versions of the control.

Once we have any update on it, we will let you know here.

Thank you.

Hi,


In our upcoming fix, your issue would be sorted out. We have now added the API “LoadValueList” in GridValidation class.
You may use it in the demo project in the following way:
e.g
Sample code:

GridWorksheet sheet = gridwebtest1.WorkSheets[0];
GridValidation gv = sheet.Validations.Add();
gv.AddACell(2,2);
gv.ValidationType=GridValidationType.FreeList;
gv.LoadValueList(listColumn.ColumnValue, listColumn.DisplayValue, listColumn.DisplayColumn, false);

Hopefully, we will provide you the fixed version of Aspose.Cells.GridWeb in the next few days after incorporating other enhancements and fixes and performing QA.

Once the fix is available, we will let you know here.

Keep in touch.

Thank you.

The issues you have found earlier (filed as CELLSNET-43952) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.