Thanks Jeffry for your reply.
Well,we can chagne width of datagrid on column strech even.I am 
iterating all coloumn and assigning sum of these colums's width to 
datagrid.

This works fine in case of all column except the last one.It does not 
allow me to increase width of last column.However I can decrease it.

While debugging I found that In case of last column Strech,MouseUp 
Event does not get triggred because Mouse Moves out of grid area for 
strechng last column. I could not figure out how to make this event 
triggred. 


I am attaching code here,Please have a look if anoyne of you get 
time. 


MMXL Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="absolute" xmlns:ns2="*" 
        horizontalScrollPolicy="auto" 
        >
<mx:Script>
        <![CDATA[
                import events.MusicEvent;
                import mx.events.ListEvent;
                import mx.events.ScrollEvent;
                import mx.controls.Alert;
                import mx.controls.listClasses.IListItemRenderer;
        
  function StrechTheColumn(eve:Event):void{
                  dg.width = songs.width + lyric.width + 
singer.width  + 3 ;
                
  }
        ]]>
</mx:Script>

<ns2:DataGridCustom id="dg"      height="50%" 
horizontalScrollPolicy="auto" columnStretch="StrechTheColumn(event)"
         y="10" >
  <ns2:dataProvider>
                 <mx:Array>
                    <mx:Object song="Sound of Silence" singer = "NA" 
lyric="In restless dreams I walked alone" />
                    <mx:Object song="Sound of Silence" singer = "NA" 
lyric="Narrow streets of cobblestone" /> 
                    <mx:Object song="Sound of Silence" singer = "NA" 
lyric="neath the halo of a street lamp"/> 
                    <mx:Object song="Sound of Silence" singer = "NA" 
lyric="I turned my collar to the cold and damp" /> 
                                                                      
                                       
                 </mx:Array>
              </ns2:dataProvider>  
              <ns2:columns>
                  <mx:DataGridColumn  id="songs" dataField="song" 
width="400" />
                  <mx:DataGridColumn  id="lyric" dataField="lyric" 
width="100"/>
                  <mx:DataGridColumn  id="singer" dataField="singer" 
width="100"/>
                  
                  
              </ns2:columns>            
        
</ns2:DataGridCustom>   

</mx:Application>

DataGrid Class:
 
   package {
        import mx.controls.DataGrid;
        import mx.controls.dataGridClasses.DataGridHeader;

        public class DataGridCustom extends DataGrid
        {
                public function DataGridCustom()
                {
                        super();
                }
                
        override protected function drawSeparators():void
    {
        DataGridHeader(header).needRightSeparatorEvents = true;
        DataGridHeader(header).needRightSeparator = true;
        super.drawSeparators();
    }
 } 
}

Regards,
Dharmendra Chouhan




 









--- In flexcoders@yahoogroups.com, Jeffry Houser <j...@...> wrote:
>
> 
>  Columns are only resizable within DataGrid, and clicking / 
dragging 
> columns does not change the width of the DataGrid. 
> 
>  If I understand correctly you want to be able to expand the 
DataGrid by 
> clicking and dragging the last column; is that correct? 
> 
>  Off the top of my head, I don't know of any default way to do 
that. 
> 
> Dharmendra Chauhan wrote:
> > HI All,
> >         I am struggling with last column of flex2 dataGrid.
> > I have set HS policy to auto, all column are resizable except 
last.
> > I can decrease its width but It does not allow me increase it.
> >
> > Does anybody know how STRECH last column widht to increase at at 
right 
> > of the DG
> >
> > Thanks,
> > Dharmendra  
> >
> >    
> >
> >
> >
> > ------------------------------------
> >
> > --
> > Flexcoders Mailing List
> > FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-
b4cf-1e62079f6847
> > Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.comYahoo! Groups Links
> >
> >
> >
> >
> >   
> 
> -- 
> Jeffry Houser, Technical Entrepreneur
> Adobe Community Expert: http://tinyurl.com/684b5h
> http://www.twitter.com/reboog711  | Phone: 203-379-0773
> --
> Easy to use Interface Components for Flex Developers
> http://www.flextras.com.com?c=104
> --
> http://www.theflexshow.com
> http://www.jeffryhouser.com
> --
> Part of the DotComIt Brain Trust
>


Reply via email to