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
1878
Disable Bands
posted

Hi,

maybe this is an easy task but I couldn't solve it. til now

I've an object that is bound to a WinGrid using a BindingSource. This object has some properties like strings etc. and a property with a list (System.Collections.Generic.List<T>) containing objects of another class. This list is shown in the VS Designer as an extra band.

Since I'm only interested in showing some of the properties of the 'main' band and not the additional band I set this to hidden which works pretty fine but the property still gets accessed although it's data is not presented. The problem is that this property uses lazy initialization, fetching the data from the database which is unnecessary because it's not getting displayed at all.

My question is can I disable an entire band or is there another possibility to overcome accessing the property?

Thanks in advance,
  Wolfgang

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Wolfgang,

    qbupoew said:
    but the property still gets accessed

    Can you post the call stack when the property is being accessed? The grid should not be trying to access the value of a field which represents a hidden band. That might be a bug.

     

    In addition to what Vince suggested above, you might want to try setting the grid.DisplayLayout.ViewStyle to SingleBand and see if that helps.

    Also, try setting MaxBandDepth to 1.

     

    But even if those work, you should not have to set them.

Children