Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 2.46 KB

File metadata and controls

39 lines (32 loc) · 2.46 KB

ASP.NET Web Forms - How to get all DevExpress data editors in a container

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;
}

Files to Review

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)