Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > BindingNavigator items not disabled properly
 

BindingNavigator items not disabled properly

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!
dick giles  Friday, January 13, 2006 12:26 AM
Hi Giles,
I was facing a similar problem but then I found a workaround-

first set
BindingNavigator.DeleteItem = null;
BindingNavigatorDeleteItem.Enabled = false;

this does it.

to enable
BindingNavigator.DeleteItem = BindingNavigatorDeleteItem;
BindingNavigatorDeleteItem.Enabled = true;

hope this helps.
pbutala  Friday, July 24, 2009 9:18 PM

You can use google to search for other answers

Custom Search

More Threads

• DataGrid Control in vb2003
• Get Identity Integer
• Datagrid Header column
• VS2005: How to handle DateTime <=> DateTimePicker and NULL less verbose
• DataGridView in VB2005... can't get the error icon/tooltip to work...
• Syntax error on INSERT INTO single column auto increment table
• Joystick
• Cannot change AutoIncrement of a DataColumn with type 'String' once it has data
• How to get updated rows when grid binded to a binding list collection?
• problem with Combo Boxes, automation error