# Get index of the button inside CellRenderer

**URL:** <https://forum.kirupa.com/t/get-index-of-the-button-inside-cellrenderer/168385>\
**Category:** flash\
**Created:** [November 6, 2005, 8:17pm UTC](https://forum.kirupa.com/t/get-index-of-the-button-inside-cellrenderer/168385 "2005-11-06T20:17:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superprg](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@superprg](https://forum.kirupa.com/u/superprg)\
**Post date:** [November 6, 2005, 8:17pm UTC](https://forum.kirupa.com/t/get-index-of-the-button-inside-cellrenderer/168385/1 "2005-11-06T20:17:30Z")

</div>

I have created many buttons inside the datagrid. Now when the user clicks on any button how can I know the index of the corresponding button.  
I can get the index of the button in my CellRenderer.as file with  
trace(“Button index is:”+button\_index);

function setValue(str:String, item:Object, sel:Boolean) : Void  
{  
button\_index=item.lov;  
button.\_visible = (item != undefined);  
}

I just want the index of the cell where button was pressed in the datagrid.  
If 3rd button is pressed, how can I get this info?  
Thanks
