tags:

views:

17

answers:

1

I have an itemrenderer used by multiple datagridcolumns and I need to have some condition in the itemrenderer based on the headertext of the datagrid column. Can I access the headertext property from within the itemrenderer?

My itemrenderer extends the LinkButton control and implements the IDropInListItemRenderer interface.

Thanks

+3  A: 

Yes, you can. Since your item renderer implements IDropInListItemRenderer, it is getting BaseListData via listData setter. From BaseListData you get owner, columnIndex, rowIndex. Owner may not be list itself, but its parent will (I don't remember exactly, you have to check it in debug).

alxx
I debugged and I found that the owner is the datagrid so I got the headerText like this: _listData.owner.columns[_listData.columnIndex].headerText. Thank You
Yasmine