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
790
Binding to empty collections of Custom Objects
posted

I have a business object that inherits from IBindingList that is built to contain other custom objects.  If I bind the grid to a list that already has items in the list everything is fine.  If I bind the grid to an empty list, it appears that the grid adds and then removes several lines (I assume it is trying to get column names, etc) as part of the SetDataSource call.  This behavior is causing some serious performance issues with our objects.  Is there a way to turn this behavior off...or at least delay it until a row is added to the list?

Parents
  • 469350
    Verified Answer
    Offline posted

    The grid doesn't actually do this directly, the grid asks the BindingManager for the data schema, and the BindingManager creates and then cancels rows in order to get the structure.

    There's no way to avoid this once the grid is bound. But you could, of course, hold off on binding the grid until you have some rows in your data.

Reply Children