后台代码:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dhcc.Botest;
using Dhcc.Entity;
using System.Collections.Generic;
using System.Windows.Forms;
public partial class Person : System.Web.UI.Page
{
private ArrayList args = new ArrayList();
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
BoPerson boperson = new BoPerson();
this.grid.DataSource = boperson.FindAll();
this.grid.DataBind();
if (!IsPostBack)
{
PageCommon.GetArgs(args, "Person.aspx", Request, Response);
ViewState["pid"] = args[1];
int p_id = Convert.ToInt32(ViewState["pid"].ToString());
//p_id = 5;
this.grid.PageIndex = p_id;
}
}
protected void grid_RowDeleted(object sender, DevExpress.Web.Data.ASPxDataDeletedEventArgs e)
{
int id = 0;
IEnumerator ids = e.Keys.Values.GetEnumerator();
while (ids.MoveNext())
{
id = (int)ids.Current;
}
BoPerson boperson = new BoPerson();
if (boperson.DelPersonInfoById(id))
{
common.Alert("删除成功!","Person.aspx");
}
else
{
common.Alert("删除失败!");
}
Page_Load( sender, e);
}
}
删除按钮是用的
<dxwgv:GridViewCommandColumn VisibleIndex="10">
<ClearFilterButton Visible="True">
</ClearFilterButton>
<DeleteButton Text="删除" Visible="True">
</DeleteButton>
</dxwgv:GridViewCommandColumn>
当点击删除时,能够触发删除事件,并且一直运行到Page_Load( sender, e);
都没有出错。在Page_Load()中也运行正常,数据绑定时,this.grid.DataSource 所绑定的数据已经是删除以后的数据了。但是在程序执行完成之后,aspxgridview控件确不能够正常刷新。一直显示loading。。。。。点击页面刷新后,才能够显示删除后的页面。
一句话就是代码运行没有任何问题,就是运行玩了之后页面的显示不正常,需要重新刷新。这个问题,在使用数据源控件的时候不存在。我想可能是dxperience控件的原因吧。不知道这么解决,希望知道的能够帮忙解答。