this is a simple example, it might be useful. Basically, all i'm doing is 
increasing the panel height everytime i add a row into the datagrid.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
 xmlns:s="library://ns.adobe.com/flex/spark" 
 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
  <s:layout>
    <s:VerticalLayout horizontalAlign="center" paddingTop="10"/>
  </s:layout>

  <fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
                        
        [Bindable]
        private var myDP:ArrayCollection = new ArrayCollection([
{col0:"something", col1:0, col2:'goes', col3:'in', col4:'here'},
{col0:"something", col1:0, col2:'goes', col3:'in', col4:'here'},
{col0:"something", col1:0, col2:'goes', col3:'in', col4:'here'},
{col0:"something", col1:0, col2:'goes', col3:'in', col4:'here'},
{col0:"something", col1:0, col2:'goes', col3:'in', col4:'here'}
        ]);
                        
        public function addRow():void
        {
          dg.dataProvider.addItem({col0:"something", col1:0, col2:'goes', 
col3:'in', col4:'here'});
          pnl.height += dg.rowHeight; 
          //pnl.invalidateDisplayList(); // my test doesnt need this but yours 
might
        }
                        
        ]]>
  </fx:Script>
  <s:Button label="addRow" click="addRow()"/>   
  <s:Panel id="pnl" title="panel" width="400" height="250">
    <s:DataGrid id="dg" dataProvider="{myDP}" width="320" height="100%">
    <s:columns>
      <s:ArrayList>
        <s:GridColumn dataField="col0"/>
        <s:GridColumn dataField="col1"/>
        <s:GridColumn dataField="col2"/>
        <s:GridColumn dataField="col3"/>
        <s:GridColumn dataField="col4"/>
      </s:ArrayList>
     </s:columns>
    </s:DataGrid>
   </s:Panel>
</s:Application>


--- In flexcoders@yahoogroups.com, "flexlearner19" <flexlearner19@...> wrote:
>
> no replies  :(
> 
> --- In flexcoders@yahoogroups.com, "flexlearner19" <flexlearner19@> wrote:
> >
> > hi all
> > 
> > i am using a custom component (extended spark panel ,added some buttons on 
> > the header)and that  contains a datagrid.now my problem  is whenver I add a 
> > row  to the datagrid,the panel is not  updating it s height.So that i get a 
> > scrollbar  in the datagrid. I need to avoid the scrollbar.
> > 
> > 
> >   any ideas to fix this ...please help..
> >
>


Reply via email to