title: Get mx:AdvancedDataGrid Selected Item
body: <p>I am having a heck of a time getting my id value from the XML item associated with the selected DataGrid row.</p>
  
  <p><img src="https://i.stack.imgur.com/pepmt.png" alt="enter image description here"></p>
  
  <p>It is strange because I get the selectedObject XML no problem, but for some reason I can't get the id out of it.  </p>
  
  <pre><code>&lt;mx:AdvancedDataGrid dataProvider='{pData}' sortExpertMode="true" id="myDataGrid" 
                                   width="100%" height="120" paddingLeft="0" dragEnabled="true"
                                   selectionMode="multipleCells" allowMultipleSelection="true"
                                   keyUp="onSelection(event)" mouseUp="onSelection(event)"
                                   draggableColumns="false"  &gt;
  
  private function onSelection(event:Event):void
          {
  
              for each(var s:Series in myBarChart2.series){
                  // initialize/empty dataTipItems of all series.
                  s.dataTipItems = [];
              }
              // For each of the selected cells to show multiple data tips at once    
              var n:int = event.currentTarget.selectedCells.length;
  
              var selectedObject:XML = event.target.data;
              var theId = selectedObject.playerStats.id.toString();
  </code></pre>
  
  <p>Please help me.</p>