I think the reason for this is that any access of the columns property
returns a *copy* of that array.  So when you make changes to a column,
like columns[0].dataField=whatever, you are working on a copy of the
column.

 

That last assignment, dg.columns = cols;, puts the copy back in the
property.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of dave_defusion
Sent: Wednesday, November 07, 2007 6:51 AM
To: [email protected]
Subject: [flexcoders] Re: DataGrid changing dataField property at
runtime and updating datagrid

 

That works, thanks for that, although it does seem a bit of a hack to
me. Anyway the important thing for now is that it works.

-D

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> I would try:
> 
> 
> 
> Var cols:Array = dg.columns;
> 
> dg.columns = cols;
> 

 

Reply via email to