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

Do grid summaries include non-visible rows when aggregating?

3 Answers 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 03 Jul 2009, 04:05 AM
If I have a grid full of data and I hide some of the rows (by setting row.IsVisible = false), will my column summaries exclude those rows from the calculations? Or do I need to physically remove the row from the grid?

Thanks,
Ben

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 03 Jul 2009, 11:50 AM
Hi Ben,

No, this will only make the rows invisible. You should exclude the row values manually. This can be done when handling the GroupSumaryEvaluate event.
I hope this helps, If you need further assistance please write me back.

Best wishes,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ben
Top achievements
Rank 1
answered on 03 Jul 2009, 11:54 AM
Do you have a sample of this? Or is there something in the demo stuff illustrating how to use this event?

Thanks,
Ben
0
Jack
Telerik team
answered on 06 Jul 2009, 11:21 AM
Hello Ben,

This can be done when handling the GroupSummaryEvaluate event. This event fires when calculating the summary item value. Here is a sample:

void radGridView1_GroupSumaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e) 
    int sum = 0; 
    foreach (GridViewDataRowInfo row in this.radGridView1.Rows) 
    { 
        if (!row.IsVisible) 
        { 
            sum += (int)row.Cells["ID"].Value; 
        } 
    } 
    e.Value = (decimal)e.Value - sum; 

I hope this helps. Should you have further questions, don' t hesitate to ask.

Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Ben
Top achievements
Rank 1
Answers by
Jack
Telerik team
Ben
Top achievements
Rank 1
Share this question
or