Janis,

I haven't tried this in Flex, but I had a similar problem years ago
with VB, where I wanted the total of all the rows to always be the
last row displayed in the grid. As you know scrolling in the grid is
the problem.

So the easy solution is to create a second grid that has a single row,
and no headers, and position that at the bottom of your main data
grid. The columns will have the same widths as the main grid.

Hope this helps 

Andrew

--- In flexcoders@yahoogroups.com, "Janis Radins" <[EMAIL PROTECTED]> wrote:
>
> I just tried to make same thing yesterday.
> Collecting values is not a problem, and there is no problem with
adding that
> row to dataProvider.
> Though I ran in huge problems while trying to keep that line on
bottom of
> dataGrid when user is rearanging data in table.
> Code looked something like this:
>       private function onSorting(event:DataGridEvent):void {
>                 setTimeout(function ():void {
>                     for(var i:uint = 0;
i<displayTable.dataProvider.length;
> i++){
>                         if(displayTable.dataProvider[i].num == "") {
>                             var totals:Object =
> displayTable.dataProvider.removeItemAt(i);
>                             displayTable.dataProvider.addItem(totals);
>                             displayTable.invalidateList();
>                             return;
>                         }
>                     }
>                 }, 10);
>             }
> setTimeout is needed because DataGridEvent.HEADER_RELEASE is broadcasted
> before actual rearranging of data.
> This code actually never worked as I wanted to. I cought some
strange tihngs
> during testing like
> displayTable.dataProvider.addItemAt(totals, 3);
> trace(displayTable.dataProvider.getItemIndex(totals)); wont trace 3, but
> last value, so theres maybe a bug in ArrayCollection class, or thats
only me
> who is doing something wrong.
> 
> Anyways, if someone has ideas how to keep one row constantly at
bottom, I
> preciate that.
> 
> Janis
>


Reply via email to