-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyGridFooterMenu.cs
33 lines (32 loc) · 1.08 KB
/
MyGridFooterMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using DevExpress.XtraGrid.Menu;
using System;
using System.Collections.Generic;
using System.Linq;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraGrid;
namespace Q354185.MyXtraGrid {
public class MyGridFooterMenu : GridViewFooterMenu {
public MyGridFooterMenu(GridView view)
: base(view) {
}
public override void Init(object info) {
var myInfo = info as GridHitInfo;
base.Init(info);
var rowSummaryItem = View.GetRowSummaryItem(myInfo.RowHandle, myInfo.Column);
SetSummaryItem((GridGroupSummaryItem)rowSummaryItem.Key);
if (myInfo.HitTest != GridHitTest.RowFooter) {
return;
}
var item = myInfo.FooterCell.ColumnInfo.Tag as GridGroupSummaryItem;
SetSummaryItem(item);
}
private void SetSummaryItem(GridGroupSummaryItem item) {
if (item == null) {
return;
}
SummaryItem = item;
CreateItems();
}
}
}