Hi,
Testing with the latest 8.6.3 version of Aspose.Cells, I find that a cell’s validation list values are returned in a seemingly random order.
For example, in the attached Test.xlsx file, I have set up a data validation of type List in cell A1, allowing it to contain only a value from the range C1:C8. C1:C8 contains the following values:
C1: (none)
C2: Monday
C3: Tuesday
C4: Wednesday
C5: Thursday
C6: Friday
C7: Saturday
C8: Sunday
In Excel, when I select cell A1 and click on the validation drop down, the drop down list shows the options above in the order displayed. However, when I run the following code:
LoadOptions options = new LoadOptions(LoadFormat.Xlsx);
Workbook wkbook = new Workbook(@“C:\Temp\Test.xlsx”, options);
Worksheet wksheet = wkbook.Worksheets[0];
var validationForA1 = wksheet.Validations.GetValidationInCell(0, 0);
if (validationForA1.Type == ValidationType.List)
{
StringBuilder sbuf = new StringBuilder();
object[] itemArray = (object[])validationForA1.Value1;
foreach (object item in itemArray)
{
sbuf.Append(item);
sbuf.AppendLine();
}
Console.WriteLine(sbuf.ToString());
}
The options printed to console are in a different order:
Wednesday
Thursday
Sunday
Tuesday
Friday
Saturday
Monday
(none)
Any reason why the items are in a different order to Excel?
Thanks,
Lawrence.
Hi,
Thanks for your posting and using Aspose.Cells.
We were able to observe this issue. However this is not a bug and it should be improvement that Aspose.Cells should show list values in Excel order.
We have therefore logged this issue in our database for investigation. We will look into it and improve this feature. Once, there is some fix or other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-44169 - Validation.Value1 array order is different to what is shown in Excel .
Hi,
Thanks for using Aspose.Cells.
It is to inform you that we have fixed your issue CELLSNET-44169 now. We will soon provide the fix after performing QA and including other enhancements and fixes.
Hi,
I’ve tested the fix version and the problem is now solved.
Thanks!
Hi,
Thanks for your feedback and using Aspose.Cells.
It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.
The issues you have found earlier (filed as CELLSNET-44169) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.