I think dataProvider.selectedIndex is doing that? _____
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Cox Sent: Friday, November 17, 2006 8:32 AM To: [email protected] Subject: RE: [flexcoders] Re: Auto incrementing values for datagrid 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: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 17 November 2006 16:14 To: [email protected] 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" <[EMAIL PROTECTED]> 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... >

