IBindingList and Datagrid Refresh Issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phillip

    #1

    IBindingList and Datagrid Refresh Issue

    I have a DataGrid bound to a custom collection that
    implements IBindingList. The collection returns true for
    AllowNew. The collections AddNew() method creates a new
    object, adds it to the collection and returns the new
    object.

    The SupportsChangeN otification property returns true and
    the appropriate ListChangedEven tArgs are used in the
    ListChanged event. All fine no problem. However:

    If there are items in the collection, and therefore items
    in the DataGrid, when the AddNew() method of the
    collection is called, all is well and the datagrid adds a
    new blank row bound to the new object. Super.

    If however the collection is empty, and therefore no rows
    in the DataGrid, when AddNew() method of the collection is
    called, the DataGrid responds by adding a new row, but
    with no columns. Just a tiny bit of white on the left hand
    side of the area where the columns are supposed to be.

    I have tried calling Invalidate and refresh on the Grid
    but this has not helped.

    Any help would me most appreciated.

    Many thanks

    Phillip.
Working...