The surest way to make the dataGrid refresh is to re-assign the
dataProvider:
grdProducts.dataProvider = ModelProducts;
or even
grdProducts.dataProvider = grdProducts.dataProvider; 

Tracy

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of huhgawz
Sent: Tuesday, October 25, 2005 6:31 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Redraw or Refresh DataGrid

 Hi all,

The idea is to change the height of certain row. The next code does it
well but after change the height of that row the grid need to be
redraw. So I add the next line inside resizeFirstRow function but
nothing is happen:

grdProducts.redraw();

Someone help me please....Thanks in advance...


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
        <mx:Model id="ModelProducts">
                <product>
                        <name>Coca Cola</name>
                        <price>10</price>
                </product>
                <product>
                        <name>Pepsi</name>
                        <price>12</price>
                </product>
        </mx:Model>
        
        <mx:Script>
        <![CDATA[
                function resizeFirstRow() {
                        var
row:mx.controls.gridclasses.DataGridRow=grdProducts.rows[0];
                        row.height=40;
                } // resizeFirstRow
        ]]>
        </mx:Script>
        
        <mx:Button label="ResizeFirstRow" click="resizeFirstRow()" />
        <mx:DataGrid id="grdProducts" width="90%" height="150"
dataProvider="{ModelProducts.product}" variableRowHeight="true">
                <mx:columns>
                        <mx:Array>
                                <mx:DataGridColumn columnName="name"
headerText="Name" />
                                <mx:DataGridColumn columnName="price"
headerText="Price" />
</mx:Array>
                </mx:columns>
        </mx:DataGrid>
</mx:Application>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to