How find child controls in Flex4

RakeshBhandari
RakeshBhandari used Ask the Experts™
on
Dear Experts,
                     I workig Flex4 and i coding in Actionscript3. my problem is how will find child controls of the datagrid in Flex4, especialy dynamic child controls?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,
I am not sure if I well understood your problem.

If you want to access a child member attached to each cell, iterate through each cell and subsequently loop through the numChildren for each cell container to get the list of items attached to it.

Warm Regards
Deepanjan Das
http://deepanjandas.wordpress.com

Author

Commented:
Hi,
    I asking is there any property or method to find out  child controls(Dynamic) in datagrid using Actionscript3.
   For eg. in .Net we can use  gridview.Findcontrols() to findout childcontrols. Like this any method available in Flex.
  If not how  achive this?.
As far as I know, there is no such given API to get that.

You will have to run a loop for each datagrid cell if you want to get the elements each cell wise.

for e.g.
for(var i:int=0; i<datagridCell.numChildren; i++){
  var element:* = datagridCell.getItemAt(i); //element holds each child items.
  element.doSomething();
}

Warm Regards
Deepanjan Das
http://deepanjandas.wordpress.com

Author

Commented:
Hi,

I gving you one Screen shot of datagrid and checkbox which is generated dynamicaly.
i need to know how will write cell value of checkboxes  from datagrid?
grid.jpg
So you are using CellRenderer - right? what kind of renderer mxml or as based?

Warm Regards
Deepanjan Das
http://deepanjandas.wordpress.com

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial