Search code examples
apache-flexbuttonlabelitemrendereradvanceddatagrid

Using button in AdvancedDataGrid


Possible Duplicate:
Buttons in AdvancedDataGrid in Flex

i want data in an AdvancedDataGrid column to be displayed as buttons instead. That means the label of the button should display the text that the cell used to display . Can this be done using item renderer? The data provider to this grid is an Array and the array key that acts as datafield for this column is "AppNo". This is how i've set the button using itemRenderer -

<mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
 <mx:itemRenderer>
   <mx:Component>
    <mx:Button/>
   </mx:Component>
 </mx:itemRenderer>     
</mx:AdvancedDataGridColumn>

I tried setting label using label="{array["AppNo"]}" but did not work. Any clues??


Solution

  • <mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
     <mx:itemRenderer>
       <mx:Component>
        <mx:Button label="{data.AppNo}"/>
       </mx:Component>
     </mx:itemRenderer>     
    </mx:AdvancedDataGridColumn>