title: How to end/stop item edit in Flex DataGrid
body: <p>Normally, you update the data bound to a datagrid item like this:</p>
  
  <pre><code>    protected function onGridEditEnd(event:DataGridEvent):void
      {
          if (grid.dataProvider != null &amp;&amp; event != null)
          {
              var editor:Object = event.currentTarget.itemEditorInstance;
  
              if (event.columnIndex == getColumnIndex(columnA) {
                      collection[event.rowIndex].name = TextInput(editor).text;
              }
          }
      }
  </code></pre>
  
  <p>The <code>itemEditEnd</code> event is dispatched right after the user finishes editing.
  So, what if I want to </p>
  
  <ol>
  <li>End the edit (from another method or handler other than <code>itemEditEnd</code> handler)</li>
  <li>Update the value of the bound data item at the same time.</li>
  </ol>
  
  <p><strong>"while"</strong> the item is being edited by the user.</p>
  
  <p>For example; how do I trigger this from a <code>keyDown</code> event handler?</p>
  
  <p>Note: You could call <code>onGridEditEnd(null)</code> which would end the edit but not update the data. <code>onGridEditEnd(new DataGridEvent(DataGridEvent.ITEM_EDIT_END, ...))</code> would work but you also need to store and pass values like columnIndex, rowIndex, dataField, etc.. which does not seem to be the best and simplest way.</p>
  
  <p>thanks...</p>