Hi Alex

Thanks for the feedback. Sorry I must be being a bit dim here, do you
have some example code to point me to?

I find Flex great fun and easy to use. I have built an MP3 player and
used datagrids and the docs covered this really well. But I cannot
find this stuff in the docs and so could do with a pointer here.

Thanks
-D

On 10/16/07, Alex Harui <[EMAIL PROTECTED]> wrote:
>
> You want to set selectedItem if you can get your hands on the exact item in 
> the dataprovider.  Otherwise, you have to scan for the item in order to 
> figure out the index of it and set selectedIndex.  If you have sorted your 
> collection, you can use findAny on an IViewCursor, but that essentially does 
> a scan too.
>
>
> Because there are different ways to scan, it is not a feature of the controls.
> ________________________________

>
> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
> Jeffry Houser
> Sent: Tuesday, October 16, 2007 10:32 AM
> To: [email protected]
> Subject: Re: [flexcoders] Can the Datagrid do this ?
>
>
>  I think selectedIndex needs an integer. You'd have to loop over the
>  data provider, figure out which one has capital==Paris' and then set the
>  selectedIndex based on that.
>
>  You could also experiment with selectedItem; although I haven't
>  experimented with setting that.
>
>  d coda wrote:
>  >
>  >
>  > Hi all
>  >
>  > I need to programmatically select a particular row in a datagrid and
>  > cannot see how it is done. I want to do the same as if the user
>  > clicked on a row only programmatically.
>  >
>  > Say I had a DataGrid with ID=dg containing two columns Countries and
>  > Capitals.
>  >
>  > I want to be able to issue a command like:
>  >
>  > dg.selectedIndex = dg.capitals=="Paris ";
>  >
>  > ie to select the row that contains Paris in the Capitals column.
>  >
>  > As if the user selected the France/Paris row only doing it 
> programmatically.
>  >
>  > I am thinking it must be a feature but cannot find it :(
>  >
>  > Please shed some light or even let me know if what I want sounds crazy.
>  >
>  > -D
>  >
>  >

Reply via email to