Hi Joan,
Thanks for the reply. It was really helpful.But the problem now is
that the datagridcolumn rating is picking 'b' or 'i' or 'e' from the
array collection and now I have to map 'b' to 'beginner' in the
combobox. Similary I have to map 'i' to 'intermediate' in combobox
and similary I have to map 'e' to 'expert' in combobox. How to get on
with it?
--- In [EMAIL PROTECTED]ups.com,
"Joan Lafferty" <[EMAIL PROTECTED]> wrote:
>
> Anurag,
>
>
>
> Yes, as someone pointed out before, you can use a custom
itemRenderer.
> Yours would look something like the code provided below. Notice
that if
> you want the ComboBox to be editable, you should specify that
> renderIsEditor="true" and specify the editorDataField.
>
>
>
> <mx:DataGrid id="skillDG" width="100%"
height="100%"
> sortableColumns="true" dataProvider="{_model}"
editable="true">
> <mx:columns>
> <mx:Array>
> <mx:DataGridColumn headerText="Skill Name"
> dataField="skillName" editable="false"/>
>
> <mx:DataGridColumn headerText="Rating"
> dataField="ratingId" rendererIsEditor
>
<http://flashteam.macromedia.com/flashplatform/imd/zaphod/deliverables
/Z
>
orn/LangRef/mx/controls/dataGridClasses/DataGridColumn.html#rendererIs
Ed
> itor> ="true" editorDataField="selectedItem"
>
>
> <mx:itemRenderer>
>
> <mx:Component>
>
> <mx:ComboBox>
>
> <mx:dataProvider>
>
> <mx:String> beginner</mx:String>
>
> <mx:String> intermediate</mx:String>
>
> <mx:String> expert</mx:String>
>
> </mx:dataProvider>
>
> </mx:ComboBox>
>
> </mx:Component>
>
> </mx:itemRenderer>
>
> </mx:DataGridColumn>
>
> </mx:Array>
> </mx:columns>
> </mx:DataGrid>
>
>
>
> Joan
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
On
> Behalf Of sahay17
> Sent: Monday, September 11, 2006 2:38 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Datagrid with a dropdown column!
>
>
>
> Hi all,
> I am having a datagrid "skillDG" with 2 datagridcolumn
as "skillName"
> and "ratingId" which is picking data from arraycollection.
>
> <mx:DataGrid id="skillDG" width="100%"
height="100%"
> sortableColumns="true" dataProvider="{_model}"
editable="true">
> <mx:columns>
> <mx:Array>
> <mx:DataGridColumn headerText="Skill Name"
> dataField="skillName" editable="false"/>
>
> <mx:DataGridColumn headerText="Rating"
> dataField="ratingId" />
>
> </mx:Array>
> </mx:columns>
> </mx:DataGrid>
>
> But now i want that my datafieldcolumn "ratingId" to be a
dropdown
> with skills namely beginner,intermediate and expert. Is it possible?
>
> Thanks and Regards,
> Anurag.
>