This is a migrated thread and some comments may be shown as answers.

Hidding detail grid rows but allowing the footer sum row to show.

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Holdorf
Top achievements
Rank 1
Steve Holdorf asked on 27 Aug 2012, 02:50 PM
I have a master/detail RadGrid that is using the detail row footer to display a sum of the detail rows. What I need to do is to display only the detail row footer row values but hide all of the actual detail rows. How can I do this?

Thanks,

Steve Holdorf

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Aug 2012, 07:25 AM
Hello Steve,

Could you please try the following approach and let me know if it helps you?
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    HideDetailItems(RadGrid1.MasterTableView);
}
public void HideDetailItems(GridTableView tableView)
{
    GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
    foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
    {
        foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
        {
            foreach (GridDataItem dataItem in nestedView.Items)
            {
                dataItem.Visible = false;
            }
            if (nestedView.HasDetailTables)
            {
                HideDetailItems(nestedView);
            }
        }
    }
}

That should do the trick.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Steve Holdorf
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or