1 Reply Latest reply on Apr 5, 2007 8:12 AM by peterent

    Adding dynamic rows and columns on datagrid

    rajeeva_nagaraj Level 1
      Hi,

      How can i add rows and columns at runtime in flex builder 2

      plz find me some solution
        • 1. Re: Adding dynamic rows and columns on datagrid
          peterent Level 2
          Rows are added to the DataGrid by adding records to the dataProvider (eg, an ArrayCollection using its addItem function).

          You can add columns like this:

          var cols:Array = grid.columns; // where grid is a DataGrid id
          var newCol:DataGridColumn = new DataGridColumn();
          newCol.headerText = "New Column";
          newCol.dataField = "newField";
          cols.push( newCol );
          grid.columns = cols;