Hi,
I have a Wingrid bound to a custom object (the grid is setup as single band only), the custom data object have certain properties which are actually collection of other related objects. When I bind this custom object to the grid, the grid try to read all these collection properties although it does not show the data from these collection properties as grid display is set to single band. My problem with this is as soon as grid first reference these collection properties, it trigger code withing custom object to fill these collections (i.e. these collection properties are null initially and only loaded if client ask for it. some sort of on demand propteries to save time loading the object).
Is there a way using some attribute etc. so that when I mark these properties with the attribute grid does not access them?
Thx
Thx, Browsable(false) attribute did the trick.
Are you sure it's the grid accessing these properties? It might be the BindingManager do it in order to determine the data type of the field.
You should also set the ViewStyle on the grid to SingleBand and also set grid.DisplayLayout.MaxBandDepth to 1.
I think you can hide properties from the grid using the Browsable(false) attribute.