Hi Bob,
You'll need to call a recursive method, since some controls are container controls. So, maybe something along these lines (off the top of my head):
protected void SetBindingSource(Control control)
{
for (int i=0; i < control.Controls.Count; i++)
{
this.SetBindingSource(control.Controls[i]);
}
}
~~Bonnie
>I am using a Custom Control (based on a Panel) to contain all sorts of controls, which in turn contain all sorts of controls, which may contain all sorts of controls.
>
>I need to iterate through all the controls so that I can set the BindingSource at runtime. Does anyone know an easy way to get to all of the controls, a simple foreach at the top level won't cut it.
>
>Thanks.
>
>Bob