Hello,
I have a .NET 2.0 windows forms application with some TextBox controls and a BindingNavigator on the form that are bound to a BindingSource. The BindingSource has a DataView as the DataSource, and when I change the DataView AllowNew or AllowRemove properties to true or false, the BindingNavigator immediately reflects the changes, enabling or disabling the Add and Delete buttons. However, I can always write on the TextBox controls, independently of the value in the AllowEdit property.
Does anyone know how to enable and disable the editing on the controls in this situation
Thanks in advance for any help given.
Regards,
paulo

Disable editing in data-bound controls
Julie Brazier
foreach (Control ctl in this.Controls)
{
if (ctl is TextBox)
ctl.Enabled = false;
}
Good luck...
coozdrm
lauch
Indeed, I wanted to stay away from enabling or disabling controls because I can have a control that I want always disabled, and when I enable or disable the others I want that specific one to remain disabled in any case. If there was an automatic method that was a better solution. Why do the controls fail to change to read-only when AllowEdit is false
Anyway, I can iterate all databound controls using:
for (int i = 0; i < bindingSource.CurrencyManager.Bindings.Count; i++)bindingSource.CurrencyManager.Bindings[ i ].Control.Enabled = false;
Thanks.
Regards,
paulo
Stephen Weatherford MS