It sounds like you're using Flex 2.0.1. We struggled with a few similar DataGrid issues, but haven't had any trouble since upgrading to Flex 3. In 2.0.1, the best workaround we could come up with for column visibility problems was programatically toggle the last column's visibility property once data was loaded. It forced many of the display areas to refresh and didn't cause flicker. The code looked something like this:
public static function refreshDataGrid(dg:DataGrid):void { var column:DataGridColumn = dg.columns[dg.columns.length-1]; column.visible = !column.visible; column.visible = !column.visible; } Then it's just a matter of calling this method at the right time. We did so when the dataProvider property was changed. We also had some functionality for showing sets of columns based on a dropdown. If you'll be doing this throughout your app, the best practice we've come across has been to extend the DataGridColumn class and add a "groupId" property. Then extend the DataGrid class and add a method like "showGroup(groupId:String)" or even a property like "displayedGroup". The logic is pretty straightforward, and it's been an effective way for us to manage column sets. -Nick Matelli Amentra, Inc --- In flexcoders@yahoogroups.com, "Barry Evans" <[EMAIL PROTECTED]> wrote: > > I got round this i think by setting the visible property of a column > when a state's enterState event fired. > > I was using a single datagrid to display two different sets of columns, > depending on a combobox selection. > > Hope this helps. > > Barry > > --- In flexcoders@yahoogroups.com, "tomeuchre" <braz@> wrote: > > > > --- In flexcoders@yahoogroups.com, Jehanzeb Musani <jehanzeb_bs@> > > wrote: > > > > > > That's exactly what I was saying. There is some issue > > > with datagrid data binding in case of invisible > > > columns. You can try manually setting the visible > > > property of that column to false after rebinding the > > > xmllist. > > > > > That is what I do...it was just one of those "that's strange..." > > moments, so I captured an event after the grid was freshly bound and > > set the visible=false; on columns that needed it. It all happens in 1 > > hundredth of a blink, so I just did it and moved on. Never throught > > that it may have been a bug, but if you are switching dataProviders, > > logically it could be completely different columns, so its not so > > surprising that it gets reset. > > >