Thank you, everyone! I ended up solving the problem with the following
code:

/*
     XML from HTTPService looks like this:

     <books>
         <book author="" title="" />
         ...
     </books>

     XMLListCollection is set as dataProvider for the DataGrid.

*/

var books:XMLListCollection = new
XMLListCollection(XMLList(event.result..books));

// Suppress repeating Author values
var lastAuthor:String = "";
var i:int = 0;
for each (var book:XML in books) {
     if ([EMAIL PROTECTED] == lastAuthor) {
         [EMAIL PROTECTED] = "";
     }
     lastAuthor = [EMAIL PROTECTED];
     i++;
}

Michael

--- In flexcoders@yahoogroups.com, "michael_p_levine"
<[EMAIL PROTECTED]> wrote:
>
> Given data that looks like this:
>
> Record #1: Author=John Doe, Title=Advanced Cat Juggling
> Record #2: Author=John Doe, Title=Surviving Cat Scratch Fever
> Record #3: Author=Bill Smith, Title=The Alligator Whisperer
> Record #4: Author=Bill Smith, Title=Living With One Ear
>
> How do I suppress the repeating Author name values in Rows #2 and #4
of
> a DataGrid so it looks like this?
>
> Author      Title
> ------      -----
> John Doe    Advanced Cat Juggling
>              Surviving Cat Scratch Fever
> Bill Smith  The Alligator Whisperer
>              Living With One Ear
>
> I've checked the group archives and haven't found a real answer to
this
> question. Has anyone else encountered and solved this?
>
> Thank you,
> Michael
>

Reply via email to