Syncfusion XlsIO 中的组合框
您好,我是 Syncfusion 产品的新手, 我需要获取在 Excel 文件中创建的组合框的值 我发现:
IComboBoxShape 包含 SelectedValue 和 SelectedIndex 但不是所有的价值观。
我应该
在我的代码中
var xlApp = xl.Excel;
var wkbk = xlApp.Workbooks.Open(stream);
var sheet1 = kbk.Worksheets[0];
var combobox = sheet1.ComboBoxes[0];
使用另一件事吗?我应该怎么办?
Hi I am new with Syncfusion product,
I need to get the values of combobox created in excel file
I found :
IComboBoxShape that contains SelectedValue and SelectedIndex
But not all the values.
Should I use another thing
here is my code
var xlApp = xl.Excel;
var wkbk = xlApp.Workbooks.Open(stream);
var sheet1 = kbk.Worksheets[0];
var combobox = sheet1.ComboBoxes[0];
and after that? What should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,通过指定单元格范围将项目绑定到 Excel 组合框。特定单元格范围中存在的值在 Excel 文件中列为 ComboBox 项目。此外,即使引用/绑定的单元格位于不同的工作表中,Essential XlsIO 也会返回正确的范围。属性“xlComboBox.ListFillRange”保存为填充组合框项目而引用/绑定的单元格范围。使用此属性,您可以检索范围,然后迭代该范围以获取所有组合框项目。我附上了用于检索 ComboBox 项目的代码片段。
如果对您有帮助,请告诉我。
Usually the items are binded to the Excel ComboBox by specifying the range of the cells. The values present in the particular range of cells are listed as ComboBox items in Excel files. Also, Essential XlsIO returns the proper range even through the referenced/binded cells are in different worksheet. The property "xlComboBox.ListFillRange" holds the range of the cells which are referenced/binded for populating the combobox items. Using this property, you can retrieve the range and then iterate through the range to get all the combobox items. Herewith i have attached the code snippet to retrieve the ComboBox items.
Let me know if it helps you.