How can I disable toolstripitems in BindingNavigator?

I want to enable or disable toolstripitems in bindingnavigator software programmatically.

When I try to set the enableStripitem enable property it doesn't change. It does not throw any exceptions, but the value of the Enable property does not change.

What did I miss?

+1


source to share


1 answer


BindingNavigator

takes control of these buttons to enable / disable them as needed; those. you cannot go prev / next, if there is no more data, you cannot add / remove without the main source letting you ( IBindingList.AllowNew

/ .AllowRemove

.

What buttons do you want to customize? For example, you can disable add / remove using data source like BindingList<T>

, and install AllowNew=false

/ AllowRemove=false

.



Alternatively, just write your own buttons entirely (forget BindingNavigator

) - it's not a lot of work, especially if you start with BindingSource

in a form (since it has everything you need MoveFirst()

, etc ..

+3


source







All Articles