Steve is correct. Sorry if I didn't make that clear in my post; that
was the reasoning behind asking if you always wanted the first item to
read as #1. If you're looking for the item's index in the dataProvider
(and you're using an ArrayCollection) you could do something like
myAC.getItemIndex(data);

HTH,
Ben


--- In flexcoders@yahoogroups.com, "Steve Cox" <[EMAIL PROTECTED]> wrote:
>
> Sorry to jump into the thread but unfortunately rowIndex doesn't do what
> it says on the tin. It's documented to return the index of the item in
> the dataprovider, however in actual fact it returns the index of the row
> in the list/datagrid. 
> 
> For example if you have a dataprovider with 100 records displaying in a
> datagrid with 10 rows and you scroll to the bottom of the datagrid and
> select the last row rowIndex would return 10; not the 100 you would
> expect. 
>  
> AFAIK there is no simple way of simply returning the index of the item
> in the dataprovider rather than the datagrid. I hope someone can pick me
> up on this point?
>  
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of ben.clinkinbeard
> Sent: 17 November 2006 16:14
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Auto incrementing values for datagrid
>  
> > this field should re-paint itself on sorting of any other fields.
> Do you mean that the first row in the grid should always say "1",
> regardless of how the list is sorted? If that is the case, you'll want
> to create an itemRenderer that implements IDropInListItemRenderer, and
> then displays the rowIndex property of BaseListData. This is probably
> a good starting point:
> 
> http://jessewarden.
> <http://jessewarden.com/archives/2006/10/checkbox_item_r.html>
> com/archives/2006/10/checkbox_item_r.html
> 
> HTH,
> Ben
> 
> --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
> ups.com, "flxcoder" <flxcoder@> wrote:
> >
> > --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
> ups.com, "flxcoder" <flxcoder@> wrote:
> > >
> > > I want to have a serial number field in my datagrid that increases
> or
> > > auto increments with each row. Is this possible? this field should
> > > re-paint itself on sorting of any other fields.
> > >
> > any ideas here? surely, flex has a way to have a serial number auto
> > incrementing column value for the datagrid...
> >
>



Reply via email to