1 Reply Latest reply on Jun 17, 2010 11:50 PM by Flex harUI

    Date sort on Datagrid when null values exists in the column

    Anil Kumar_Flex

      Hi All,

       

      When I am trying to sort by using custom sort function on Datagrid of Date column I am thrown with the following exception.  My datagrid column contains null values.  My requirement is, null values  should be sorted and should be displayed at the starting or ending of  the grid based on the sort order (ascending / descending).

       

      Find criteria must contain at least one sort field value.
          at mx.collections::Sort/findItem()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\c ollections\Sort.as:491]
          at mx.collections::ListCollectionView/getItemIndex()[C:\autobuild\3.2.0\frameworks\projects\ framework\src\mx\collections\ListCollectionView.as:513]
          at ListCollectionViewCursor/collectionEventHandler()[C:\autobuild\3.2.0\frameworks\projects\ framework\src\mx\collections\ListCollectionView.as:2154]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.collections::ListCollectionView/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\collections\ListCollectionView.as:833]
          at mx.collections::ListCollectionView/internalRefresh()[C:\autobuild\3.2.0\frameworks\projec ts\framework\src\mx\collections\ListCollectionView.as:1275]
          at mx.collections::ListCollectionView/refresh()[C:\autobuild\3.2.0\frameworks\projects\frame work\src\mx\collections\ListCollectionView.as:402]
          at mx.controls::DataGrid/sortByColumn()[C:\autobuild\3.2.0\frameworks\projects\framework\src \mx\controls\DataGrid.as:3560]
          at mx.controls::DataGrid/headerReleaseHandler()[C:\autobuild\3.2.0\frameworks\projects\frame work\src\mx\controls\DataGrid.as:4909]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9298]
          at mx.controls.dataGridClasses::DataGridHeader/mouseUpHandler()[C:\autobuild\3.2.0\framework s\projects\framework\src\mx\controls\dataGridClasses\DataGridHeader.as:1259]

       

       

      Any help is appreciated.

      Thanks in advance