it! Question: Given the following piece of code, do I have to declare the
"ControlDelegate"? Is there something that I could be using that would be a
bit more general purpose here and elseware? Possibly using a generic type?
Thanks
SearchControls(e.Row.Controls, delegate(Control control) {>>>>
Button button = control as Button;
if (button != null) {
if (button.CommandName == "Delete") {
button.Enabled = false;
}
}
});
private void SearchControls(ControlCollection controls, ControlDelegate
controlDelegate) {
foreach (Control control in controls) {
if (control.HasControls()) {
SearchControls(control.Controls, controlDelegate);
}
controlDelegate(control);
}
}
private delegate void ControlDelegate(Control control);