Flex DataGrid中平添Label,Button,CheckBox,ComboBox

Flex DataGrid中添加Label,Button,CheckBox,ComboBox

本贴转自http://blog.csdn.net/Mecoolshow/archive/2010/11/30/6046084.aspx
<mx:DataGrid id="dgList" resizableColumns="false" x="510" y="430" rowCount="6" dataProvider="{_fileList}" width="480" rowHeight="27">  

 <mx:columns>  

  <mx:DataGridColumn headerText="文件名称列表" dataField="docName"/>  

  <mx:DataGridColumn headerText="文本测试显示">  

   <mx:itemRenderer>  

    <mx:Component>  

     <mx:Label text="showText" color="#00089" textDecoration="underline" useHandCursor="true"   

         buttonMode="true"  mouseChildren="false" click="单击方法"/>  

    </mx:Component>  

   </mx:itemRenderer>  

  </mx:DataGridColumn>  

  <mx:DataGridColumn textAlign="center"headerText="CheckBox" dataField="你要指定的字段" >  

   <mx:itemRenderer>  

    <mx:Component>  

     <mx:CheckBox paddingLeft="30" selected="true/false" click="单击方法 "/>  

    </mx:Component>  

   </mx:itemRenderer>  

  </mx:DataGridColumn>  

  <mx:DataGridColumn textAlign="center" width="70" headerText="Button">  

   <mx:itemRenderer>  

    <mx:Component>  

     <mx:Button label="Button" buttonMode="true" cornerRadius="4" click="单击方法"  />  

    </mx:Component>  

   </mx:itemRenderer>  

  </mx:DataGridColumn>  

   <mx:DataGridColumn headerText="测试显示" dataField="completePreStr" editorDataField="value" id="jindu" editable="true" >  

            <mx:itemEditor>  

                <mx:Component>  

                        <mx:ComboBox editable="true" width="100">  

                            <mx:dataProvider>  

                                <mx:String>test1</mx:String>  

                                <mx:String>test2</mx:String>  

                                <mx:String>test3</mx:String>  

                                <mx:String>test4</mx:String>  

                                <mx:String>test5</mx:String>  

                            </mx:dataProvider>  

                        </mx:ComboBox>  

                </mx:Component>  

            </mx:itemEditor>  

</mx:DataGridColumn>  

 </mx:columns>  

</mx:DataGrid>