i am using devexpress gridview 9.2.
i have 2 gridview having 2 colum --> Item & Rate. the Rate total is displayed on the footer for each gridview.
summary type="sum" is enabled for each grid.
i want to display result in a label.
The result is obtained from the S开发者_开发知识库um of two gridview's FOOTER Sum colum .
Is this possible?
after both your Grids Are bound to DataSource, call the below method. However, Label cannot be updated if grids update via callbacks. in that case you need to use AspxCallback Panel, place 2 grids & label in Callback Panel, and PerformCallback on the CallbackPanel when grids need to be updated:
private void UpdateSummaryLabel(){
double rate1 = double.Parse(grid1.GetTotalSummaryValue(grid1.TotalSummary["Rate", DevExpress.Data.SummaryItemType.Sum]).ToString());
double rate2 = double.Parse(grid2.GetTotalSummaryValue(grid2.TotalSummary["Rate", DevExpress.Data.SummaryItemType.Sum]).ToString());
label.Text = String.Format("{0:n2}", rate1 + rate2);
}
精彩评论