Hi,
Thanks for the prompt solution.

Thanks,
Anurag.

--- In flexcoders@yahoogroups.com, "Joan Lafferty" <[EMAIL PROTECTED]> wrote:
>
> Since your dataProvider has values of 'b', "i" and 'e", then, your
> ComboBox dataProvider should also have these values:
> 
> <mx:ComboBox labelFunction='outerDocument.myLabelFunction">
>  <mx:dataProvider>
>  <mx:String> b</mx:String>
>  <mx:String> i</mx:String>
>  <mx:String> e</mx:String>
>  </mx:dataProvider>
>  </mx:ComboBox>
> 
>  
> 
> Then, you can set a labelFunction on the ComboBox itemRenderer like
> this:
> 
> private function myLabelFunction(item:Object):String
> 
>     {
> 
>         switch(item)
> 
>         {
> 
>            case "b": return "beginner";
> 
>            case "i": return "intermediate";
> 
>            default: return "expert";
> 
>         }
> 
>     }
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of sahay17
> Sent: Monday, September 11, 2006 10:47 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Datagrid with a dropdown column!
> 
>  
> 
> 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 flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> , "Joan Lafferty" <tan@> 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
> 
<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: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of sahay17
> > Sent: Monday, September 11, 2006 2:38 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.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.
> >
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/
 



Reply via email to