//取消编辑
            if (e.CancelMode == ListViewCancelMode.CancelingEdit)
            {
                //e.Cancel = true;
                lvDepartment.EditIndex = -1;
                BindData();
                HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.AbsolutePath);
            }
            else if (e.CancelMode == ListViewCancelMode.CancelingInsert)
            {
                BindData();
                HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.AbsolutePath);
                return;
            }

解决方案 »

  1.   

    自己解决了:
     protected void ListView_ItemCanceling(object sender, ListViewCancelEventArgs e)
            {
                if (e.CancelMode == ListViewCancelMode.CancelingEdit)
                {
                    ListView1.EditIndex = -1;
                    BindData();
                }
                else if(e.CancelMode == ListViewCancelMode.CancelingInsert)
                {
                    ListView1.InsertItemPosition = InsertItemPosition.None;
                    BindData();
                }
            }