Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6335331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:50:09+00:00 2026-05-24T18:50:09+00:00

I am generating A datagrid with Array collection. When The datagrid is generated some

  • 0

I am generating A datagrid with Array collection. When The datagrid is generated some extra row are created at the end of grid. How i remove that extra Row or stop them to generate.

My code that generate Grid

private function createGrid(dataPrvdr:ArrayCollection, columnsValue:Array /*of Objects*/ = null):void
        {
            if (dataPrvdr && dataPrvdr.length)
            {
                includeInLayout = true;
                var grid:DataGrid = new DataGrid();

                if (columnsValue)
                {
                    var cols:Array = grid.columns;
                    for (var i:int = 0; i < columnsValue.length; i++)
                    {
                        for (var prop:String in columnsValue[i])
                        {
                            //addDataGridColumn(prop, columnsValue[i][prop], grid);
                            cols.push(DataGridColumn(columnsValue[i][prop]));
                        }
                    }

                    grid.columns = cols;
                }

                grid.dataProvider = dataPrvdr;
                grid.percentWidth = 99;
                grid.styleName = "dataGridReport";  
                grid.setStyle("headerBackgroundSkin",DataGridHeaderBlueSkin); 

                grid.sortableColumns = false;
                grid.editable = false;
                grid.variableRowHeight = true;
                grid.resizableColumns = false;

                grid.rowCount = grid.dataProvider.length;
                grid.headerHeight = 20;
                grid.rowHeight = 16;
                grid.verticalScrollPolicy = ScrollPolicy.OFF;
                addElement(grid);

                if (!grids)
                    grids = [];

                grids.push(grid);
                grid.addEventListener("multiLineLabelItemRendererHeightChanged", rendererHeightChanged, false, 0, true);
                grid.addEventListener(FlexEvent.CREATION_COMPLETE, function (event:FlexEvent):void
                {
                    grid.invalidateSize();
                }, false, 0, true);
            }
        }

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:50:09+00:00Added an answer on May 24, 2026 at 6:50 pm

    When you set the height property of the datagrid, it overrides the rowCount

    You can set the height in your code as:

    grid.height = grid.dataProvider.length * grid.rowHeight + grid.headerHeight;
    

    Cheers,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am auto generating my columns <DataGrid Grid.Row=0 AutoGenerateColumns=True VerticalAlignment=Stretch HorizontalAlignment=Stretch Name=dataGrid1 ItemsSource={Binding Customers}
I'm generating some xml files that needs to conform to an xsd file that
when generating python wrappers with swig the python wrapper classes in the generated python
I'm generating some XML documents and when it comes to the address part I
i am using a data grid in flex and i am generating data from
I have a Windows form that's generated using code (including buttons and what not).
When generating IL using DynamicMethod it's possible to call methods and access fields that
I'm generating images from an original and storing them in a table. I want
So, WPF calls ToString() on objects when generating TextColumns in DataGrid and then i
I currently set some of my fields on my data grid with c2 as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.