RE: [flexcoders] Re: Finding the index of the first visible row in a Datagrid
verticalScrollPosition matches the offset of the first visible row From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of iko_knyphausen Sent: Thursday, April 19, 2007 11:27 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Finding the index of the first visible row in a Datagrid Oohps, misread your question. The total number should be in the length property. As for the first visible, I don't know, but you can use the datagrid.scrollToIndex method make sure a specific item is visible. --- In flexcoders@yahoogroups.com, Steven Lira [EMAIL PROTECTED] wrote: I'm trying to find the index of the row in a datagrid which is the first visible row. ex. If there are 100 rows but only 15 are visible at any given time, I want to know what the index is of first visible row presented in the window. If the window is scrolled down half way, I should find that the index of the first visible row is 50 (or something like that). Someone mentioned using listData but it is null. I also need to know what the total number of rows are. Thanks, Steve
[flexcoders] Re: Finding the index of the first visible row in a Datagrid
I needed to do this after insert in a sorted grid... for (x=0; xdgItems.dataProvider.length [EMAIL PROTECTED] != [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ; x++); otherwise the selectedIndex property should tell you. HTH --- In flexcoders@yahoogroups.com, Steven Lira [EMAIL PROTECTED] wrote: I'm trying to find the index of the row in a datagrid which is the first visible row. ex. If there are 100 rows but only 15 are visible at any given time, I want to know what the index is of first visible row presented in the window. If the window is scrolled down half way, I should find that the index of the first visible row is 50 (or something like that). Someone mentioned using listData but it is null. I also need to know what the total number of rows are. Thanks, Steve
[flexcoders] Re: Finding the index of the first visible row in a Datagrid
Oohps, misread your question. The total number should be in the length property. As for the first visible, I don't know, but you can use the datagrid.scrollToIndex method make sure a specific item is visible. --- In flexcoders@yahoogroups.com, Steven Lira [EMAIL PROTECTED] wrote: I'm trying to find the index of the row in a datagrid which is the first visible row. ex. If there are 100 rows but only 15 are visible at any given time, I want to know what the index is of first visible row presented in the window. If the window is scrolled down half way, I should find that the index of the first visible row is 50 (or something like that). Someone mentioned using listData but it is null. I also need to know what the total number of rows are. Thanks, Steve
[flexcoders] Re: Finding the index of the first visible row in a Datagrid
Thanks for the info. I actually found what I was looking for: DataGrid has a verticalScrollPosition attribute which is the index of the top visible row. --- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote: Oohps, misread your question. The total number should be in the length property. As for the first visible, I don't know, but you can use the datagrid.scrollToIndex method make sure a specific item is visible. --- In flexcoders@yahoogroups.com, Steven Lira stevenclira@ wrote: I'm trying to find the index of the row in a datagrid which is the first visible row. ex. If there are 100 rows but only 15 are visible at any given time, I want to know what the index is of first visible row presented in the window. If the window is scrolled down half way, I should find that the index of the first visible row is 50 (or something like that). Someone mentioned using listData but it is null. I also need to know what the total number of rows are. Thanks, Steve