Hi.
I want to be able to reorder the data grid when you click on column headings.
I have a code to order collection.
My idea is that when the user click in a column headings, i execute a method to order a collection.
my code is Coleccion.order(collection, "nombre", "desc"), but i don't know cast CPersistentCollection in Collection.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I have a datagrid.dataSource=obj.items, items is a CPersistenCollection. I need order for any atribute.
I want order my CPersistentCollection. I have code to order this, how can I do it ??
My code order a collection.
Saludos
Victor
Hi Victor,
I'm not quite sure what you are asking here?
Do you want to be able to reorder the data grid when you click on column headings?
Or
Do you want to be able to run a retrieve criteria to populate a persistent collection while ordering the objects?
The reordering of the grid is a complex databinding issue and you'll need to tackle that one yourself (check google, codeproject, msdn, etc)
The retrievecriteria is fairly easy - all you need to do is add an attribute to order by using the AddOrderAttribute() method of the RetrieveCriteria
- Richard
Hi.
I want to be able to reorder the data grid when you click on column headings.
I have a code to order collection.
My idea is that when the user click in a column headings, i execute a method to order a collection.
my code is Coleccion.order(collection, "nombre", "desc"), but i don't know cast CPersistentCollection in Collection.
The PersistentCollection is an IList, and so is a normal collection.
You could change the type of the first parameter from Collection to IList and you should be OK.
As a note, PersistentCollection inherits from CollectionBase, not Collection which will be why you cannot do a successful type conversion.
- Richard