Let's say that we want to put the Checkbox in one of the columns of AdvancedDataGrid. I like using HierarchicalData or HierarchicalCollectionView as my datagrid's dataProvider:
// TestGrid
<mx:AdvancedDataGrid id="myADG">
<mx:columns>
<AdvancedDataGridColumn id="col1" />
<AdvancedDataGridColumn id="col2" itemRenderer="LeafCheckbox" />
</mx:columns>
</mx:AdvancedDataGrid>
// LeafCheckBox.mxml
<mx:Box
creationComplete="init(event)"
implements="IDropInListItemRenderer">
<mx:Script>
<![CDATA[
// Internal variable for the property value.
private var _listData:BaseListData;
// Make the listData property bindable.
[Bindable("dataChange")]
// Define the getter method.
public function get listData():BaseListData
{
return _listData;
}
// Define the setter method,
public function set listData(value:BaseListData):void
{
_listData = value;
}
private function init(event:Event):void {
var dg:AdvancedDataGrid = this.listData.owner.parent as AdvancedDataGrid;
if (!dg.dataProvider.hasChildren(dg.selectedItem))
this.addChild(new CheckBox());
}
]]>
</mx:Script>
</mx:Box>
That should be most of it. Let me know, thanks!