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

GridView Refresh Group Totals

3 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam
Top achievements
Rank 1
Adam asked on 01 Nov 2010, 07:39 PM
Hi Guys,

I am working with a GridView that is using the Grouping  the ChildTable features.
Each Group contains a child table of information as well as parent rows within the group itself.

When rows in the Child Table are updated ideally I should be throwing a property change event that causes an update to the parent row. But my attempts tin acheiving this just couldn't get the parent row to see what was happening). Consequently i went tactical and am doing the update of the parent row data via the CellEditEnded function in the child table. This all works great.

My last challenge is i need the currrent Group Totals FOR THE PARENT ROWS to be refreshed. The only way i have managed to do this is calling 'Rebind' which i think is a horrible solution! Is there a better way? I am using the standard SUM aggregate functions of the Telerik Grid.

 

 

private void dgChildItemList_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)

{

 

     List<ItemEntity> List = ((RadGridView)sender).Items.Cast<ItemEntity>().ToList();

     switch (e.Cell.DataColumn.DataMemberBinding.Path.Path.ToString())

     {

 

 

        case "myColumn":

       //this changes parent row data without the need for a rebind; using PropertyChanged event
       ((

 

SummaryEntity)e.Cell.ParentRow.GridViewDataControl.ParentRow.DataContext).myColumn = GetTotal();

 

 

 

 

        break;

           }
           
           //needed cause the total don't reflect the update otherwise!
     dgRiskEntryList.Rebind();

}

Any help much appreciated!

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 03 Nov 2010, 05:01 PM
Hi Adam,

Basically, for the time being calling Rebind() is the way for recalculating the aggregates in the GroupHeader. We are in the process of researching a far more appropriate approach for achieving the same functionality and we will implement it as soon as we could provide the best possible solution.
However, if you share more information about your exact scenario with details about the properties exposed, the type of aggregate functions and the expected behavior, I may be able to suggest another approach. 

Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Stephen
Top achievements
Rank 1
answered on 03 Sep 2012, 07:52 AM
Hi

We are having a similar issue. Our grid has quite a number of rows and columns so we don't really want to call Rebind() to update the group aggregates if we don't need to.

Has there been any further progress made on a better solution for this?

Regards
0
Maya
Telerik team
answered on 06 Sep 2012, 09:06 AM
Hello Stephen,

Could you clarify what is your exact scenario ?  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Adam
Top achievements
Rank 1
Answers by
Maya
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or