Hi Mark,

You can come probably up with a more elegant way to handle each
possibility, but here's an idea.

myDG.verticalScrollPosition = (myDataProvider - array[i]) >
(myDataProvider.length - myDG.rowCount) ? (myDataProvider.length -
myDG.rowCount) : array[i];

-TH

--- In [email protected], "Mark" <[EMAIL PROTECTED]> wrote:
>
> I have a basic datagrid that is getting the data from an
> arrayCollection with each item having a startDate field, among
> others. My boss wanted me to have the datagrid scroll down to the
> item that has the same start date as todays date. Basically I'm just
> looping thru the arrayCollection to find it and scroll down to it
> using:
>
> myDG.verticalScrollPosition = array[i];
>
> This works fine unless that item is at the end of the datagrid. Then
> it adds rows to the DG so that item is at top. What would be the
> proper way to do this so if it's the last item, it just scrolls to the
> bottom without adding more rows?
>
> Thanks,
> Mark
>



Reply via email to