Hi, I've had the same problem and notice it also occurs when I resize the column widths. Is there a way to disable being able to adjust the columns? (also to prevent sorting on columns)
Thanks Bill --- In [email protected], "Sergey Kovalyov" <[EMAIL PROTECTED]> wrote: > > Hi All! > > I have a DataGrid and its dataProvider property is binded to > ArrayCollection. When I first hide one column via firstColumn.visible = > false and then binding executes, that column appears again. How to prevent > this unnecessary appearance? Click "Hide Middle Name" and then "Populate" in > this example: > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > creationComplete="onCreationComplete()"> > > <mx:Script> > > <![CDATA[ > > *import* mx.collections.ArrayCollection; > > [*Bindable*] > > *protected* *var* users : ArrayCollection; > > *protected* *function* onCreationComplete() : *void* { > > users = *new* ArrayCollection(); > > users.addItem({firstName : *"George"*, middleName : *"W"*, lastName : * > "Bush"*}); > > } > > *protected* *function* onPopulateButtonClick() : *void* { > > users = *new* ArrayCollection(); > > users.addItem({firstName : *"Victor"*, middleName : *"A"*, lastName : * > "Yuschenko"*}); > > } > > ]]> > > </mx:Script> > > <mx:DataGrid dataProvider="{users}"> > > <mx:columns> > > <mx:DataGridColumn id="firstNameDataGridColumn" dataField="firstName" > headerText="First Name" /> > > <mx:DataGridColumn id="middleNameDataGridColumn" dataField="middleName" > headerText="Middle Name" /> > > <mx:DataGridColumn id="lastNameDataGridColumn*"* dataField="lastName" > headerText="Last Name" /> > > </mx:columns> > > </mx:DataGrid> > > <mx:Button label="Hide Middle Name*"* click=" > middleNameDataGridColumn.visible = *false*" /> > > <mx:Button label="Populate" click="onPopulateButtonClick()" /> > > </mx:Application> > Sergey. >

