[Gambas-user] Changing the key value in a collection

Jussi Lahtinen jussi.lahtinen at ...626...
Fri Nov 20 16:13:14 CET 2009


Probably not good answer, but can you use something else as key?
Maybe you should add ID value for those items.
If value you use for key is editable, you should be aware that collection can't
have same key twice...

Jussi


On Fri, Nov 20, 2009 at 06:16, bbb888 <bbruen at ...2308...> wrote:
>
> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list