开发者

AdvancedDataGrid problem with programmatically adding a column

开发者 https://www.devze.com 2022-12-17 18:49 出处:网络
I have a Problem with adding columns programmatically to a AdvancedDataGrid. The code: var cols:Array = thisDataGrid.columns;

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

精彩评论

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

关注公众号