Your condition statement should be something like this:

if (grid1.dataProvider.getItemAt(j).read == 'u'){
   grid1.rows[j].setStyle('fontWeight', 'bold');
} else {
   //do nothing
}

You might also want to change the line:

> for( var j:Number=0; j < grid1.rows.length; j++){

to something like this:

var len = grid1.length;
for (var j:Number=0; j<len; j++)

Alot of the 'properties' like length etc tend to 
run 'getter'/'setter' functions so just getting the value once will 
speed up the performance.

Derrick


--- In flexcoders@yahoogroups.com, "Reto M. Kiefer" <[EMAIL PROTECTED]> 
wrote:
> Hi,
> 
> I have a datagrid which contains some data from email headers like 
read, 
> from, subject etc.
> 
> The dataprovider is a webservice:
> 
> <mx:dataProvider> {mail_Manager.listInbox.result} 
</mx:dataProvider>
> <mx:columns>
> <mx:Array>
> <mx:DataGridColumn columnName="id" headerText="Id" width="50"/>
> <mx:DataGridColumn columnName="pid" headerText="Part" width="50"/>
> <mx:DataGridColumn columnName="read" headerText="Read" width="50"/>
> <mx:DataGridColumn columnName="from" headerText="From" 
width="150"/>
> <mx:DataGridColumn columnName="subject" headerText="Subject"/>
> <mx:DataGridColumn columnName="sendtime" headerText="Date" 
width="150"/>
> </mx:Array>
> </mx:columns>
> 
> 
> I want to check if a row has a cetain value in a cell.
> 
> So iterate over the datagrid with:
> 
> for( var j:Number=0; j < grid1.rows.length; j++){
>       //??? IF check ???
>       grid1.rows[j].setStyle('fontWeight', 'bold');
> }
> 
> This version sets every row bold but I want to have only rows in 
bold 
> that have an "u" in the column "read", I can remember reading an 
example 
> but I can't find it again.
> 
> Any help is highly appreaciated...
> 
> Thanks in advance
> 
> Reto




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to