如何从 itemRenderer 访问 dataGridColumn?

发布于 2024-08-23 20:54:37 字数 210 浏览 4 评论 0原文

我使用基于文本的自定义组件作为显示 XMLList 的 dataGrid 的 itemRenderer。我希望能够为多个列重复使用此 itemRenderer,如何访问 dataGridColumn 以便知道将哪个字段分配给文本值?

super.data 为我提供了整个 XML 项目,super.parentDocument 为我提供了整个 DataGrid

提前致谢。

I am using a custom componenet based off of text as an itemRenderer for a dataGrid that is displaying an XMLList. I want to be able to re-use this itemRenderer for multiple columns, how do I access the dataGridColumn so I know which field to assign to the text value?

super.data gives me the whole XML item, super.parentDocument gives me the whole DataGrid

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬シ愛 2024-08-30 20:54:37

找到它并不容易,但答案是:

data[(listData as DataGridListData).dataField

数据是对 XML 项目传递的引用。 listData 是任何实现 IDropInListItemRenderer 的属性。将其转换为 DataGridListData 因为它是一个 dataGrid。这使我可以访问 dataField 属性。

您可以阅读我在此处找到的整篇文章

该链接将带您直接转到我从中得到答案的页面,但整篇文章对于刚接触 itemRenderers 的人来说是一本很好的读物。

It wasn't easy to find but the answer is:

data[(listData as DataGridListData).dataField

data is a reference to the XML item passes. listData is a property of anything that implements IDropInListItemRenderer. casting it as DataGridListData cause it's a dataGrid. This gave me access to the dataField property.

You can read the whole article I found here

The link will take you directly to the page I got my answer from, but the whole article is a good read for anyone new to itemRenderers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文