2 Replies Latest reply on Aug 27, 2007 6:29 AM by scrattis

    Sorting Datagrid

      argh, frustrating!

      Is it really possible that I cant sort a datagrid with script when user presses the button.
      Lets say datagrid have three columns. Col 1, col 2 and col 3.

      I have three buttons that lead user to the datagrid and each of them should sort the datagrid by the column user clicked (equivalent button)?
        • 1. Re: Sorting Datagrid
          JKohn99 Level 1
          Just sort the underlying collection. Assuming your using an arrayCollection
          do the following:


          This is a collection of user objects where I sort by org and name.

          Then either reset the grids dataprovider or send out a Collection changed event:
          var c:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
          • 2. Re: Sorting Datagrid
            scrattis Level 1
            I am using XMLListCollection.. There is a command datagrid.SortItemsBy.... But It wont work. It just gives an error when I try to compile it.