• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

row count in datagrid

Explorer ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

Hi All

rowCount property of datagrid not working.

Any suggestions?

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="white" layout="vertical" viewSourceURL="srcview/index.html">  

<mx:Array id="arr">

  <mx:Object articleName="Finding out a characters Unicode character code" data="15" />

  <mx:Object articleName="Setting an icon in an Alert control" data="14" />

  <mx:Object articleName="Setting an icon in a Button control" data="13" />

  <mx:Object articleName="Installing the latest nightly Flex 3 SDK build into Flex Builder 3" data="10" />

  <mx:Object articleName="Detecting which button a user pressed to dismiss an Alert dialog" data="9" />

  <mx:Object articleName="Using the Alert control" data="8" />

  <mx:Object articleName="Formatting data tips in a Slider" data="7" />

  <mx:Object articleName="Downloading the latest Adobe Labs version of Flex 3 SDK/Flex Builder 3 (codename: Moxie)" data="6" />

</mx:Array>

<mx:ArrayCollection id="arrColl" source="{arr}" />  

<mx:DataGrid rowCount="9" id="dataGrid" dataProvider="{arrColl}" variableRowHeight="true" width="100%" height="100%">

  <mx:columns>

   <mx:DataGridColumn id="articleName" dataField="articleName" headerText="Name of the article in question" wordWrap="true" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

   <mx:DataGridColumn id="data" dataField="data" headerText="ID of the article" />

  </mx:columns>

</mx:DataGrid>  

</mx:Application>

TOPICS
ActionScript

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

you might get a better response on the flex forum but when you say not working what do you mean?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

I have just ran your code and get 9 rows, are you aware you only have 8 rows of data

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

when i ran the above code i get total 12 rows from which 8 are filled and 4 are blank.

I want to get rid of blank rows.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

I expect that's something to do with the datagrid height. the row count is still 9 if you trace it out

if the height of the datagrid is more that the data can fill I expect you get the extra rows displayed.

if you launch your application and resize it smaller you will notice you don't see these extra rows.

depending on what you are trying to achieve you may have to listen to the change event of datagrid and manually resize the datagrid's height as the sum of the row heights

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

LATEST

simply removing the height="100%" might also achieve what you are after

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines