Disable BindingNavigator's buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can use the form designer to disable (any of the) BindingNavigator's items,
(i.e. the MoveFirst, MovePrev, Delete, Add, etc. items). In the designer the
items are greyed out and the properties say they are disabled. However, when
the program runs they are all enabled. If I disable an item in code, in the
Form Load event for instance, it properly becomed disabled...but only until I
move to another record when it becomes enabled again. Almost as if the act of
moving from one record to another makes all the items enabled irrespective of
the design-time setting. This is the most simple form in an otherwise empty
project and I built it by following the simple instructions in the help text,
i.e. I create a data source and dropped it on the form. Please, how do I
disable the add and delete items!
 
Hi Richard,

When the position of the datasource changed, the state of the buttons on
the bindingNavigator will be reset. In this case, you can handle the
button's EnabledChanged event to disable this button. Here is an example.

private void bindingNavigatorMoveLastItem_EnabledChanged(object
sender, EventArgs e)
{
this.employeesBindingNavigator.MoveLastItem.Enabled = false;

}

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top