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
935
AllowAddNew discovered from BindingSource property change
posted

Hello,

I am using an UltraGrid bound to a BindingSource with underlying custom class derived from BindingList<T> . The custom BindingList determines the AllowNew state from the filter criteria and other properties of the items in the list. The user may change these filter criteria and so change the AllowNew state. This triggers a ListChangeEventType.Reset.

The UltraGrid correctly reads the AllowNew variable in terms of enabling/disabling AddNew functionality and correctly processes or errors the users to attempt to add a new row.

But rather than reporting an error to the user, I would like to change the display accordingly with either AllowAddNew.FixedAddRowOnTop or AllowAddNew.No providing a visible indicator of whether the action is supported.

Is there any event or other means of being notified when the UltraGrid reacts to a ListChangeEvent or changes the AllowAddNew property. InitializeLayout only seems to fire for PropertyDescriptorChanged events not for the Reset event. 

Any suggestions appreciated.

Wendy

Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    Assuming this custom BindingList<T> class is your creation, you have an awareness of when the filter criteria changes, so you could just change the grid property whenever you see that the filter criteria has changed. You could also just handle ListChanged yourself, and change the grid property when it fires.

    Note that UltraGridOverride exposes an AllowAddNew property, but the problem in this case is that it is not being explicitly set, i.e., its resolved value is changing, but there is no notification sent when that happens.

Children