multiple level ordering with CSort


i want to set a default order for a CSort and ordering a gridview for multiple cols.

i have this table:



AC/DC |1990|London

U2    |1983|Dublin

AC/DC |1984|Berlin

i want first sort for artist and next for date to get this table:



AC/DC |1984|Berlin

AC/DC |1990|London

U2    |1983|Dublin

in SQL i would simply write " ORDER BY Artist ASC,Date ASC".

how can i set this default order in CSort?

this does NOT work (got Error "Undefined index: Artist, Date "):

        $sort->defaultOrder = array(

            'Artist' => false,

            'Date' => false,


looks like default order only works for one argument?!

any ideas?

array('Artist ASC, Date ASC')

although ASC is default I think

when i use this:

$sort->defaultOrder = array('Artist ASC, Date ASC');

i’ve got a new Error "Undefined index: "

is thre any code snippet available?

Two string examples and one array example here.


thanks everybody!

found my mistake:

i extended the gridview component and overwrite some functions… and my own code throw this "undefined index"-error… so with standard gridview everything is fine