如何将 Silverlight 3.0 ListBox 内容导出到 Excel 和 Excel单词?
ListBox 包含多个ListBox,而ListBox 又包含许多ListBoxItem。顶级 ListBox 没有绑定到 ItemsSource 集合,而子 ListBox 则具有绑定到 VM 中各个属性的 ListBoxItem。有没有办法将 ListBox“内容”转储到 Excel 文件,可以先将它们转换为 XML 格式?
The ListBox contains multiple ListBoxes which inturn contain many ListBoxItems. The top level ListBox does not have a ItemsSource collection bound to it, rather the child ListBoxes have ListBoxItems that are bound to individual properties in the VM. Is there a way to just dump the ListBox "contents" to an Excel file, may be by converting them to an XML format first??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够翻译这篇关于导出的文章Excel 的数据网格到您的列表框场景。在您的情况下,您需要遍历控制树来查找每个子项的子项(可能以递归方式),然后使用 xml 将其呈现到 Excel。
You should be able to translate this post on exporting a datagrid to Excel to your list box scenario. In your case you will need to walk the control tree to find the children of each child (probably in a recursive manner) and then render it to Excel using xml.