开发者

AdvancedDataGrid problem with programmatically adding a column

I have a Problem with adding columns programmatically to a AdvancedDataGrid. The code:

var cols:Array = thisDataGrid.columns;
cols.push(dgc);
thisDataGrid.columns = cols;

does create a column, adds it to the cols array, bot the last code line has no effect. The cols wont be found in the thisDataGrid.columns property...

Wha开发者_C百科t could be the problem? I'm working with a test license, and on the advanceddatagrid the watermark shows up. Could this be a problem?

Thanks for help!

Markus


I had the same issue and resolved it by making sure that I add my ADG object into an active visual component. In my case, I just made a call to this.addElement( adg ) (or this.addChild() ) after updating the adg.column property.

It seems like the adg properties will only update when the adg is "attached" to an active visual component. I havn't taken the time to really look into the cause of this behaviour though.


try doing invalidateProperties() and invalidateDisplayList() on grid

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜