4 Replies Latest reply on Oct 14, 2011 11:10 PM by Pranav Hosangadi

    Can only select last row of dynamically built DataGrid


      This is, essentually, what I'm doing:


      private var dg:DataGrid = new DataGrid();

      private var dgCols:Array = new Array();

      private var dgArray:Array = new Array();


      // This section is overly simplistic for testing only, turns out it was a good thing


      var temp:Object = {};

      temp["1"] = "a";









      // Build the Columns for the DataGrid

      var col:DataGridColumn = new DataGridColumn();

      col.dataField = "1";




      dg.columns = dgCols;


      dg.dataProvider = dgArray;







      Nothing in there is really that complex, and the datagrid builds just fine. The problem I'm running into is that whenever I scroll over the datagrid, only the last row becomes highlighted. If I made the datagrid editable, I can select rows, other than the last one, and edit them, but only the last row is highlighted. If I build a datagrid that is created at compile time, I don't get this problem, I can highlight and select any different rows, and even multiple rows.


      Anyone have any clue as to what is going on and how to fix it?