I haven't tested this, but I suspect you could programmatically
select the row through the selectedItems property.  Add the row data
(not the index) to the selectedItems array, and the selectedIndices
property should be updated to reflect the addition.

Doug

--- In flexcoders@yahoogroups.com, "Mike Collins" <[EMAIL PROTECTED]>
wrote:
>
> I have the following for a DataGridColumn, which works just fine:
>
>  <mx:DataGridColumn  dataField="label" id="dg_products_label"
> width="65" headerText="Product" >
>                                                    
> <mx:itemRenderer>
>       <mx:Component>
>                                                    
>             <mx:Text text="{data.label}" 
> color="{outerDocument.checkProductUsage(this,data.selected)}" />
>                                                   
>       </mx:Component>
>                                              
>       </mx:itemRenderer>
>                                        
>       </mx:DataGridColumn>
>
> The function it calls looks like this:
> public function checkProductUsage(c:mx.controls.Text,
> sel:String):Number {
> if (sel == 'true') {
> //ta_debug.text = mx.utils.ObjectUtil.toString(d);
> //example of what I want - dg_products.selectedIndices.push
> (currentrow of datagrid);
>       return 0xFF0000;
> }else {
>       return 0x000000;
>       }
> }
>
> This all works, the text color changes based on the data.selected
> value, but I really want to add the row index to the
selectedindices
> of the DataGrid.
>
> How do I get the currentrow of the DataGrid from in an
itemrenderer
> like this?  Am I missing another approach?
>
> Thanks,
> Mike
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to