Adam,

You are correct, default datagrid sorting does not work properly with my
solution. I will either have to provide custom sorting or find another
solution.

I had thought that what I'm trying to accomplish here is not that
unusual in tabular data displays and have been somewhat surprised that I
haven't yet come across anyone else who has attempted and accomplished
this in Flex.

Perhaps another option is to restructuring the underlying data itself. I
will look into this and update this thread with any new
solutions/suggestions.

Thanks,
Michael

--- In [email protected], "Adam Royle" <[EMAIL PROTECTED]> wrote:
>
> Hi Michael,
>
> Haven't tried your code, but wondering if sorting the datagrid by
clicking the headers gives you inaccurate results?
>
> Or are you resetting the dataProvider on every sort?
>
> Cheers,
> Adam
>
>   ----- Original Message -----
>   From: Michael Levine
>   To: [email protected]
>   Sent: Thursday, March 22, 2007 9:44 AM
>   Subject: [flexcoders] Re: How do you suppress repeating values in
DataGrid columns?
>
>
>   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 [email protected], "michael_p_levine"
michaelplevine@ 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