Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
990
Band 0 Key Changing
posted

Hi All,

I have an UltraGrid bound to an object containing several properties one of which is a collection. That collection in turn contains objects where one of the properties is also a collection. Binding to this object creates three bands as expected: Band 0, Band 1 and Band 2. I have set the Key on each of these bands in the DisplayLayout to be Legs, Transports and Charges respectively.

At runtime the Key of Band 0 becomes BindingList`1 (the name of the type of the bound property) instead of Legs. However, the Keys of the other bands remain as I set them at design time.

Does anyone have any insight as to what's happening here and whether it is expected behaviour?

Thanks,

Andy.

 

 

  • 37774
    posted

    Andy,

    The keys of the bands are provided by the .NET BindingManager for the properties that are represented.  In your case, it sounds like Transports is the name of a property on Band 0 that is a collection, and Charges is the name of a property on the Transports band, so the BindingManager will return these properties.  You might be able to have a higher degree of control by implementing ITypedList on your base collection.

    As for the purpose of setting the name of the bands at design-time, this is so that the grid can later match up the serialized band with the band that appears at run-time and apply the properties that you had set already.

    -Matt