Reputation: 11054
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.
Upvotes: 0
Views: 1040
Reputation: 11054
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.
Upvotes: 3