Try:

  grid.selectedIndex = x - 1;

The selectedIndex property is zero-based, so in general you need to 
set it to (N - 1) to select the Nth line.


--- In [email protected], "bobrene07" <[EMAIL PROTECTED]> wrote:
>
> hello,
> 
> 
> I have a problem with the selecting index after i removed an 
element.
> 
> when i do the following: 
> 
> var x:int = grid.selectedIndex;
> 
> if (x != -1) {
>   grid.dataProvider.removeItemAt(x);
>  grid.selectedIndex = x;
> }
> 
> if x equal 4 it select the fift line.
> 
> does anyone knows how to fix it ??
> 
> thx
> 
> Bob
>


Reply via email to