Hello, I am having an issue with Aspose.Cells version 7.0.2.0 in reference to the listbox shape. I am attempting to create a listbox and assign its possible values using an input range. For some reason, all of the listbox options are rendering one over the other instead of rendering one after the other. In effect, every additional listbox option hides the listbox option above it. I had found another post on the forum about a similar problem and the suggested workaround was that I increase the height of my listbox, but I am required to make the listbox only so tall. I have created some sample code that generates the issue for me:
public class Program
{
static void Main(string[] args)
{
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add(“First Sheet”);
worksheet.Cells[0, 0].PutValue(“Jason”);
worksheet.Cells[1, 0].PutValue(“Rick”);
worksheet.Cells[2, 0].PutValue(“Jane”);
worksheet.Cells[3, 0].PutValue(“Rachel”);
Aspose.Cells.Drawing.ListBox listbox = worksheet.Shapes.AddListBox(0, 0, 1, 0, 40, 100);
listbox.InputRange = “A1:A4”;
listbox.SelectionType = Aspose.Cells.Drawing.SelectionType.Multi;
workbook.Save(@“c:\Test\MultiSelectTest_” + DateTime.Now.ToString().Replace(’/’, ‘’).Replace(’ ', '’).Replace(’:’, ‘_’) + “.xlsx”);
}
}
Any help or information would be appreciated. Thank you.
Hi,
Thanks for providing us details and sample code.
Thank you.
Hi,
Please download and try the latest fix: Aspose.Cells for .NET 7.2.0.1
The issue is caused by default number of items in a page.
Please try the
following code:
C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add(“First Sheet”);
worksheet.Cells[0, 0].PutValue(“Jason”);
worksheet.Cells[1, 0].PutValue(“Rick”);
worksheet.Cells[2, 0].PutValue(“Jane”);
worksheet.Cells[3, 0].PutValue(“Rachel”);
Aspose.Cells.Drawing.ListBox listbox = worksheet.Shapes.AddListBox(0, 0, 1, 0, 40, 100);
listbox.InputRange = “A1:A4”;
listbox.SelectionType = Aspose.Cells.Drawing.SelectionType.Multi;
int count = listbox.ItemCount;
Assert.AreEqual(count, 4);
listbox.PageChange = count;
listbox.Height = count * 15;
I have tried the code above and I am now able to render the list items one after the other. Thank you very much for the fast response and effective solution.
Hi,
It’s good to know your problem is resolved now.
If you get any other question or face any issue. Please feel free to post. We will help you asap.
The issues you have found earlier (filed as CELLSNET-40589) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.