开发者

how to increase the row space(Horizontal space) in dataGrid in flex

I want to incr开发者_如何学JAVAease the row space(Horizontal space) in DataGrid in flex

no i want horizontal space between every row. eg.

dataGrid Header --   ID  Name
1st row         --   01  A
Horizontal Space--
2nd row         --   02  B
Horizontal Space--
3rd row         --   03  C

Like this. I want to increase this horizontal space


You need to set the width of the column you want to set a specific size to. In the first column in the example below I am setting the column width to be 100px wide.

This example is taken from the live docs.

    <mx:DataGrid id="dg" 
        width="100%" height="100%" rowCount="5" dataProvider="{employees}">
        <mx:columns>
            <mx:DataGridColumn dataField="name" headerText="Name" width="100"/>
            <mx:DataGridColumn dataField="phone" headerText="Phone"/>
            <mx:DataGridColumn dataField="email" headerText="Email"/>
        </mx:columns>
    </mx:DataGrid>


Just add a itemRenderer to the column that uses a padding of x.

i.e.

<mx:DataGridColumn width="200" dataField="name" >
<mx:itemRenderer>
    <fx:Component>
        <mx:VBox paddingBottom="20" >
            <s:Label text="{data}" />
        </mx:VBox>
    </fx:Component>
</mx:itemRenderer>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜