Is Cgridview Able To Do What I Want?

Hi,

I’m currently using a cgridview to display my data queried from a database.

The data is queried by joining a few tables. "Date" and "Project" column is from project table whereas "status" and "status updated by" column is from status table. The "view details" is a link whereby when you click, you will see the description and more stuff about the project.




 -------------------------------------------------------------------------------------------------------

 |    Date       |     Project      |    Status       |  Status Updated By   |       Details           |

 -------------------------------------------------------------------------------------------------------

 | 01-09-2012    |     Project 1    |  Approve        |  Person A            |  [u]view details[/u]    |

 -------------------------------------------------------------------------------------------------------

 | 01-09-2012    |     Project 1    |  Reject         |  Person B            |  [u]view details[/u]    |

 -------------------------------------------------------------------------------------------------------

 | 01-09-2012    |     Project 1    |  Pending        |  Person C            |  [u]view details[/u]    |

 -------------------------------------------------------------------------------------------------------

 | 01-09-2012    |     Project 2    |  Reject         |  Person D            |  [u]view details[/u]    |

 -------------------------------------------------------------------------------------------------------

 | 01-09-2012    |     Project 2    |  Pending        |  Person E            |  [u]view details[/u]    |

 -------------------------------------------------------------------------------------------------------

 | 01-09-2012    |     Project 2    |  Reject         |  Person F            |  [u]view details[/u]    |

 -------------------------------------------------------------------------------------------------------



However, I want it to display in cgridview in such a way as shown below.

The Project column will only show the project once and the status will show approve as long as one person approve (eg. For project 1 show approve in the status column because person A approve even though the rest reject). And when you click "view details", you will be able to see the details of who rejected and approved the project. (eg. For project 1, you will see Person A approve, Person B reject and Person C pending when you click view details link)




 --------------------------------------------------------------------------------

 |    Date       |     Project      |    Status       |        Details          |

 --------------------------------------------------------------------------------

 | 01-09-2012    |   Project 1      |  Approve        |  [u]view details[/u]    |

 --------------------------------------------------------------------------------

 | 01-09-2012    |   Project 2      |  Pending        |  [u]view details[/u]    |

 --------------------------------------------------------------------------------



I’ve tried using “group” in the query for project name but it doesn’t return what I want. It shows the below table. Even though I’m able to display unique project but it shows nothing for the “status” column and I’m unable to display the 3 statuses when I click on the “view details” link.




 --------------------------------------------------------------------------------

 |    Date       |     Project      |    Status       |        Details          |

 --------------------------------------------------------------------------------

 | 01-09-2012    |   Project 1      |                 |  [u]view details[/u]    |

 --------------------------------------------------------------------------------

 | 01-09-2012    |   Project 2      |                 |  [u]view details[/u]    |

 --------------------------------------------------------------------------------



Can anyone advise if cgridview is able to do what I want? Or is there any other way of doing?