Hi,
I usually subclass the DataGridColumn class to customize the assigned cell
renderer. This way you can easily pass extra information (in your case the
dataprovider for the combo boxes) directly to the column. The cellrenderer then
"asks" its row for the dataprovider to use:
<mx:DataGrid ... >
<mx:columns>
<my:ExtendedDataGridColumn cellRenderer="ComboRenderer"
dataProvider="{arr1}"/>
<my:ExtendedDataGridColumn cellRenderer="ComboRenderer"
dataProvider="{arr2}"/>
<my:ExtendedDataGridColumn cellRenderer="ComboRenderer"
dataProvider="{arr3}"/>
</mx:columns>
</mx:DataGrid>
ExtendedDataGridColumn just extends the mx.controls.gridclasses.DataGridColumn
class and adds a public variable dataProvider.
Inside the cellRenderer class ComboRenderer (which you could implement as a
direct subclass of mx.controls.ComboBox) you can then access the correct
dataProvider by doing this
function init():Void {
super.init();
dataProvider = listOwner.getColumnAt(getCellIndex().columnIndex);
}
Dirk.
> -----Original Message-----
> From: Tom Fitzpatrick [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 29, 2005 5:23 PM
> To: [email protected]
> Subject: [flexcoders] Comboboxes in datagrid
>
>
>
> I'm trying to create a datagrid that holds three-column rows with a
> comboBox in each cell.
>
> I assume I have to use a cellrenderer to accomplish this - is
> this correct?
> I've been experimenting with cellrenderer examples on the
> rich internet
> apps site (Webster/McLeod) and one posted by Dirk Eismann. Both these
> assume only one comboBox per row, and I haven't found a way
> to add three
> per row, each with a different dataProvider. So close, yet so
> far. Any tips
> (or code to share)?
>
> - Tom
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/