I'm using a WinGrid in a user control, or at least attempting to. I have a bindig source set in the control and the grid is bound to the binding source. I have set specific columns and bands to be visible. I have the NewBandLoadStyle and NewColumnLoadStyle set to Hide.
Everything appears to be fine until I try to use the user control. When I place the user control on a form, the grid does not show any columns. If I set the NewBandLoadStyle and NewColumnLoadStyle to Show I see columns, but not the ones I have defined for the grid. I would expect this if the control reset the datasource, but it doesn't. I added the grid and datasource direclty to the form and set the same properties and they work fine, its only when using it through a user control that I seem to have an issue.
Can anyone point me in the right direction here?
The first thing I recommend is that you check out this article:
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
If that doesn't help, you may want to try getting the latest service release of the grid (if you don't already have it).
If that doesn't help, I'd recommend hiding the columns / bands in the InitializeLayout event of the grid rather than at design-time. This is often simpler and always more reliable than design-time.