0 Replies Latest reply on Jan 3, 2008 10:52 PM by Flex-Issac

    Data Grid Selection problem

    Flex-Issac
      Hi All,
      When I use Action Script to create DataGrid, the selection line cannot be changed in mouse click event. But the dg.selectedIndex has be changed correct row, only the selection line is no change.
      My sample code as follow:

      var dg:DataGrid = new DataGrid()
      dg.selectable = true;
      var cols:Array = new Array();
      var col1:DataGridColumn = new DataGridColumn();
      col1.dataField = "col1";
      var col2:DataGridColumn = new DataGridColumn();
      col2.dataField = "col2";
      cols.push(col1);
      cols.push(col2);
      dg.columns = cols;

      var row1:Object = new Object();
      var row2:Object = new Object();
      var row3:Object = new Object();
      var row4:Object = new Object();
      var rows:Array = new Array();
      rows.push(row1);
      rows.push(row2);
      rows.push(row3);
      rows.push(row4);
      dg.dataProvider = rows;

      The selection line always hold on last row, how to solve it let the selection line can follow the selectedIndex to change?

      Thanks