AdvancedDataGrid, Grouping/Sorting problem

I have a Flex 3 AdvancedDataGrid component where I using the GroupingCollection and that is putting it into the tree struction by group just like I would like.  But ordering them incorrectly.
The query pulls the data and orders it correctly, but it seems to randomly order it into my grid.
Any help would be greatly appreciated!
<mx:AdvancedDataGrid creationComplete="this.TrainingDM.runTrainingWizard(LoginGrid.selectedItem.UserID);"  id="RecommendedGrid2"  verticalScrollBarStyleName="ScrollBarPaper" wordWrap="true"   width="100%" height="100%" headerColors="[#ffffff, #808080]" textAlign="left" fontSize="12"  allowDragSelection="false" dragMoveEnabled="false" dragEnabled="false" dropEnabled="false" backgroundSize="100%" alpha="1.0"   backgroundImage="../Assets/napkin.jpg" backgroundAlpha=".7" cornerRadius="0" dropShadowEnabled="true" shadowDirection="right" shadowDistance="5" horizontalGridLines="true" verticalGridLines="true" verticalGridLineColor="#FF0000" horizontalGridLineColor="#D9D9FF" themeColor="#c4c400" useHandCursor="true"  buttonMode="true"  variableRowHeight="true" useRollOver="true" mouseChildren="true" selectable="true" mouseEnabled="true" headerHeight="28" fontWeight="bold" styleName="mydataGridHeaderStyle"  sortExpertMode="true" sortableColumns="true" >
	  <mx:dataProvider>
		 <mx:GroupingCollection id="gc" source="{TrainingDM.runTrainingWizard.lastResult}">
			<mx:Grouping>
				<mx:GroupingField name="ParentName"  />
				
			</mx:Grouping>
		 </mx:GroupingCollection>
	  </mx:dataProvider> 
				<mx:columns>
			<mx:AdvancedDataGridColumn    sortable="true"  headerText="CLASS NAME (RECOMMENDED):" dataField="TrainingName"   >
			</mx:AdvancedDataGridColumn>
 
 
				</mx:columns>
			</mx:AdvancedDataGrid>

Open in new window

jeresimpsonAsked:
Who is Participating?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.