This example demonstrates how to implement a method that returns a list of child data editors placed in a parent container.
private static List<ASPxEdit> GetChildControls(object Container, List<ASPxEdit> controlsList, Func<Control, bool> predicate) {
Control c = Container as Control;
if (c == null || c.Controls.Count == 0)
return controlsList;
foreach (Control item in c.Controls) {
if (item is ASPxEdit && (predicate == null || predicate(item) == true)) {
controlsList.Add((ASPxEdit)item);
}
if (item.Controls.Count > 0)
controlsList = GetChildControls(item, controlsList, predicate);
}
return controlsList;
}
- HelperClass.cs (VB: HelperClass.vb)
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
(you will be redirected to DevExpress.com to submit your response)