title: RecordIndex out of range
body: <p>I am struggling with the DevExpress grid and was wondering if anybody's got a good tip on this one. This is the code causing me grief:</p>
  
  <pre><code>If GridView.Controller.SelectedRecordCount &gt; 0 Then
  Begin
      CurrentGridRow := GridView.DataController.GetRowID( 
                        GridView.Controller.SelectedRecords[ 0 ].RecordIndex );
  End
  Else
      CurrentGridRow := 0;
  </code></pre>
  
  <p>The exception gets raised when trying to get the row id and it's correct, because, well, this code is in a RefreshData method call and there has just been a change which made the record disappear from the grid.
  Thus, what I need to solve this is some way to tell whether the recordindex is still valid.
  I did have a look around but I can't find anything helpful and google didn't want to
  share its goodies on this one.</p>
  
  <p>Has anybody got a good tip on how to make sure the record index is valid?</p>
  
  <p>Thank you very much!</p>
  
  <p>Andrea</p>