首页 新闻 会员 周边

求ASPxPivotGrid控件有经验者解答不能拖动列头问题

0
悬赏园豆:10 [待解决问题]

因为报表分析页面需要所以选择了ASPxPivotGrid。

我根据数据动态生成PivotGridField,然后在控件的load事件中将dataset绑定至控件中。

控件的基本功能已完成,唯有在列头拖动的时候不能实现。 求解。。。

附上源码:

动态生成PivotGridField

View Code
private void PivotGridDataBind(DataSet ds)
{
if (ds != null && ds.Tables["ShowRowType"] != null)
{
if (ASPxPivotGrid1.Fields.Count <= 0)
{
ASPxPivotGrid1.Fields.Clear();
int index = 0;
foreach (DataRow row in ds.Tables["ShowRowType"].Rows)
{

PivotGridField pgf
= new PivotGridField();
if (row["ShowType"].ToString() == "DCData")
{
pgf.Area
= DevExpress.XtraPivotGrid.PivotArea.DataArea;
pgf.GroupIndex
= 1;
}
else if (row["ShowType"].ToString() == "DCRow")
{
pgf.Area
= DevExpress.XtraPivotGrid.PivotArea.RowArea;
pgf.GroupIndex
= 2;
}
else if (row["ShowType"].ToString() == "DCColumn")
{
pgf.Area
= DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
pgf.GroupIndex
= 3;
}
else
{
pgf.Area
= DevExpress.XtraPivotGrid.PivotArea.FilterArea;
pgf.GroupIndex
= 0;
}

pgf.FieldName
= row["FildName"].ToString();
pgf.Caption
= row["DisplayName"].ToString();
pgf.Index
= index;
//pgf.FilterValues.Clear();
ASPxPivotGrid1.Fields.AddField(pgf);
index
++;
}
}
}
}

控件load事件

View Code
protected void ASPxPivotGrid1_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PivotGridDataBind(DataXML);
}
string reportName = DataXML.Tables["_OPERATOR"] != null ? DataXML.Tables["_OPERATOR"].Rows[0]["TABLE_NAME"].ToString() : "";
if (reportName != "")
{
ASPxPivotGrid1.DataSource
= DataXML.Tables[reportName];
ASPxPivotGrid1.DataBind();
}
}

本人在线等候你回复。。。  谢了。

飘落的枯叶的主页 飘落的枯叶 | 菜鸟二级 | 园豆:210
提问于:2011-07-28 10:18
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册