DataSource Values Duplicate

DataSource Values Duplicate

Old forum URL: forums.lhotka.net/forums/t/686.aspx


vargasbo posted on Thursday, July 20, 2006

I have the following code...

[Serializable()]
    public partial class SubscriptionCollection : BusinessListBase<SubscriptionCollection,Subscription>
    {
}

[Serializable()]
    public partial class Subscription : BusinessBase<Subscription>
    {}

Nothing really fancy here, not I have a DataSource which is of Type Subscription Collection. The issue i'm having is when I set the binding source to the SubscriptionCollection, I get the correct number of records, but the values are all the same for each records. The values in the biz object are correct, but the UI is not in sync.

bsSubscription.RaiseListChangedEvents = false;
bsSubscription.DataSource = unit.Subscriptions;
bsSubscription.RaiseListChangedEvents = true;
bsSubscription.ResetBindings(false);

Ideas?

RockfordLhotka replied on Thursday, July 20, 2006

Is GetIdValue() returning unique values for each object?

vargasbo replied on Friday, July 21, 2006

What I'm doing is...

protected override object GetIdValue()
{
      return new Criteria(this.CustomerID, this.UnitID, this.ServiceCD);
}


I'll change it up to return a guid for each object.

vargasbo replied on Friday, July 21, 2006

Yes, I'm return a guid value each time, but I'm still getting the repeating values.

RockfordLhotka replied on Friday, July 21, 2006

All I can suggest at this point then, is to walk through the code in the debugger and see where it is going wrong. I do this all the time and don't have a problem, so there's something different in your implementation that's causing the issue.

vargasbo replied on Monday, July 24, 2006

I solved the issue. The issue was this. I have a customer, when the customer load, it loads one level deep, in this case, it loads the customer - > units. When I click on my unit page, I follow the same pattern. The issue was that when I click on Unit, it reload unit and subscription, but "this" was still set to the first item in the collection, hence, why the first item kept repeating.

Thanks for the help.

Copyright (c) Marimer LLC