views:

64

answers:

1

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.

A: 

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.

invertedSpear