Code Example on “Setting dynamically rowCount property on DataGrid.”
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”init()”>
<mx:Script>
<![CDATA[
private function init():void
{
dg.dataProvider=arr;
dg.rowCount=arr.length;
}
]]>
</mx:Script>
<mx:DataGrid x=”260″ y=”125″ id=”dg” rowCount=”2″>
<mx:columns>
<mx:DataGridColumn headerText=”Names” dataField=”label” />
</mx:columns>
</mx:DataGrid>
<mx:Array id=”arr”>
<mx:Object label=”Kumar1″/>
<mx:Object label=”Kumar2″/>
<mx:Object label=”Kumar3″/>
<mx:Object label=”Kumar4″/>
<mx:Object label=”Kumar5″/>
<mx:Object label=”Kumar6″/>
</mx:Array>
</mx:Application>
Here when you run the example you can see the rows of the DataGrid changing.as that of the property.
The actual post is here and this is the code example of that post.As the viewer requested.
Enjoy the post.Comments are welcome.


August 6, 2008 at 6:22 pm |
[...] View Example for “Code Example on “Setting dynamically rowCount property on DataGrid.”” The actual post is here [...]
September 10, 2009 at 10:50 pm |
Hi! I was surfing and found your blog post… nice! I love your blog.
Cheers! Sandra. R.