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
1233
Best way to bind search results
posted

I have a winform that allows several different searches.  That is, based upon search options, a call to a wcf service uses a particular critieria object and returns a specific result set.  The form itself is the same for all searches. 

My challenge is configuring the ultradatasource to accept different shapes.  So, first, I created a data structure with a generic result mapping to band 0 and list properties for each different result shape as separate child bands.  I then set data binding to the parent object and the datamember pointing to the correct collection property.  This binds the data, but only for the fields that exist in both the parent and child object.  Additionally, the column headers do not reflect the child band, even though I configured the root band column headers to be invisible.

To complicate matters, I was using interfaces to present the binding shape and the PropertyDescriptorCollection to walk the chain of interfaces, which will not happen by default.  I've used this approach many times to ensure I present to the grid that which is expected, but it did not work in this case.

So, to simply matters, I bound directly to lists, removing the interfaces and property descriptors.  Unfortunately, the results did not change.

Next, I decided to set the data binding directly to the list collection and pass null as the data member.  Same results.

Finally, I added all fields to band 0, removed the child bands and used direct binding to the respective property list.  Although this works, it doesn't seem like the correct approach as it causes me to manage one big shape instead of smaller, more representative shapes.  Also, it forces me to repeat columns when the same column of data needs a different header caption. 

It seems like using a datamember should work.  Can you offer any advice on how to troubleshoot the binding?

Parents Reply Children
No Data