There is something wrong with datagrid bindind. I have
tried the following two examples to hide the datagrid
column

1. First Example (Without data binding)
<mx:DataGrid id="dg" editable="true">
    <mx:columns>
        <mx:DataGridColumn dataField="Artist"
headerText="Artist" editable="false" visible="false"/>
        <mx:DataGridColumn dataField="Album"
headerText="Album"/>
        <mx:DataGridColumn dataField="Price"
headerText="Price"/>
    </mx:columns>
</mx:DataGrid>

When I ran the above example, first column was not
visible. Then I add dataprovider to the above example
as shown below.

2. Second Example

[Bindable]
private var dataArray:Array = 
   [
      {Artist:'Carole King', Album:'Tapestry',   
       Price:11.99},
      {Artist:'Paul Simon', Album:'Graceland', 
       Price:10.99},
      {Artist:'Original Cast', Album:'Camelot', 
       Price:12.99},
      {Artist:'The Beatles', Album:'The White Album', 
       Price:11.99}
   ];

<mx:DataGrid id="dg" editable="true"
dataProvider="{this.dataArray}">
    <mx:columns>
        <mx:DataGridColumn dataField="Artist"
headerText="Artist" editable="false" visible="false"/>
        <mx:DataGridColumn dataField="Album"
headerText="Album"/>
        <mx:DataGridColumn dataField="Price"
headerText="Price"/>
    </mx:columns>
</mx:DataGrid>

Now when I ran the application, the first columns was
visible.

--- phipzkillah <[EMAIL PROTECTED]> wrote:

> Here is my mxml:
> 
> <mx:DataGrid id="dg" x="0" y="0" 
>       width="100%" 
>       height="100%" 
>       dataProvider="{xmlData}"
>       doubleClickEnabled="true"
>       itemDoubleClick="{updateCompanyData(event)}" 
>       headerRelease="{headerReleaseFunc(event)}">
>       <mx:columns>
>               <mx:DataGridColumn headerText="Company"
> dataField="@name"/>
>               <mx:DataGridColumn headerText="Total Active Users"
> dataField="@totalUsers"
> sortCompareFunction="sortCompareFunc"/>       
>               <mx:DataGridColumn headerText="Unique Callers"
> dataField="@uniqueCallers"
> sortCompareFunction="sortCompareFunc"/>
>               <mx:DataGridColumn headerText="Total Calls
> Attemped"
> dataField="@totalCalls"
> sortCompareFunction="sortCompareFunc"/>
>               <mx:DataGridColumn headerText="Total Successful
> Calls"
> dataField="@successCalls"
> sortCompareFunction="sortCompareFunc"/>
>               <mx:DataGridColumn headerText="Company ID"
> id="companyid"
> dataField="@id" visible="false"/>                     
>       </mx:columns>
> </mx:DataGrid>        
> 
> I want to hide the company id column, however it
> still displays.
> 
> Ideas?
> 
> 



      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Reply via email to