New to Telerik UI for WinFormsStart a free 30-day trial

Expanding all rows

Updated over 6 months ago

In order to expand all rows in RadGridView you have to iterate through them and set the IsExpanded property to true. The following code snippet demonstrates how to achieve it. You can call the method when the grid is loaded or when you click a button :

C#
void ExpandAllRows(GridViewTemplate template, bool expanded)
{
    foreach (GridViewRowInfo row in template.Rows)
    {
        row.IsExpanded = expanded;
    }
    if (template.Templates.Count > 0)
    {
        foreach (GridViewTemplate childTemplate in template.Templates)
        {
            ExpandAllRows(childTemplate, true);
        }
    }
}

See Also

In this article
See Also
Not finding the help you need?
Contact Support