I have a situation where the key for an item in a collection is an editable
value in the collection item.  Obviously, when that value changes, I need to
update the collection and change the key.  However, when I do this the item
is in a new position in the collection.  This is a problem because the
collection is "sorted" via a different item field.

I can handle the sort when the collection is built from the database, but is
there any way to get the collection back into the correct order when the key
value changes?  I don't want to persist the changes at the point where the
user changes one item.  The goal is to have them work with the set of items,
make adjustments to one or more and then persist their changes under their
control when they are happy with the overall set.  

Alternatively, is there a way to sort a gridview?  (This is the real problem
I suppose, as when the key value or any other value in the item changes, I
reload the gridview by iterating the collection.)

tia
bruce
 
-- 
View this message in context: 
http://old.nabble.com/Changing-the-key-value-in-a-collection-tp26422299p26422299.html
Sent from the gambas-user mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to