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
1459
Designer broken binding to interface hierarchy
posted

I am trying to bind the grid to a datasource defined as an interface. The interface has one property that is an ienumerable of another interface. When I set the first interface as the datasource for the grid, the designer will not let me set properties for the inner band, as it doesn't show me any of the columns for that band. I have attached a sample project to demonstrate this. Here are some screenshots to illustrate the problem:

1) This shows the grid in the designer with the inner band expanded

2) This shows the columns collection within the grid's custom property editor

 

And finally, here is the grid at runtime, populated with sample data. The inner band is displaying correctly at run time, but without design time access I can't control its appearance:

GridTest.zip
  • 1459
    Offline posted

    Hmm, the problem seems to be with the declaration of the child interface property within the parent interface. Neither of the following work:

     

    Property

     

     

     

     

    Rates As IList(Of IServiceRate)

     

     

    Property Rates As IEnumerable(Of IServiceRate)

    If I use the concrete class variant though, and declare it as a List(of ConcreteRate) then it works properly.

    How can I get around this?

  • 1459
    Offline posted

    Looks like the interface might be a red herring. I created a second binding source on the form and set its datasource to the class implementing the interface. Binding the grid to that binding source gave me exactly the same behaviour. That implies I've done something wrong here, but for the life of me I can't see what??!?