I want to enable or disable the toolstripitems on the bindingnavigator programmatically. When I try to set the toolStripitem's enable property, it does not change. It does not give any exception but the value of Enable property does not change.
What did I miss? Any ideas?
-
The
BindingNavigatortakes control of these buttons itself, to enable/disable them as appropriate; i.e. you can't go prev/next if there is no more data, you can't add/delete without the underlying source letting you (IBindingList.AllowNew/.AllowRemove.Which buttons do you want to tweak? For example, you can disable add/remove by using a data-source such as
BindingList<T>, and settingAllowNew=false/AllowRemove=false.Alternatively, simply write your own buttons completely (forget
BindingNavigator) - it isn't a lot of work, especially if you start with aBindingSourceon the form (since that has all the necessaryMoveFirst()etc.
0 comments:
Post a Comment