日期:2014-05-17  浏览次数:20494 次

ListView在增加行的时候,的取消的操作怎么实现?
 protected void ListView_ItemCanceling(object sender, ListViewCancelEventArgs e)
        {
            if (e.CancelMode == ListViewCancelMode.CancelingEdit)//取消编辑
            {
                ListView1.EditIndex = -1;
                BindData();
            }
            else if(e.CancelMode == ListViewCancelMode.CancelingInsert)//取消增加
            {
                       这里面要怎么实现取消增加的操作呢??????
                            }
        }

------解决方案--------------------
//取消编辑
            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;
            }

------解决方案--------------------
没弄过,帮顶下
------解决方案--------------------
引用:
//取消编辑
            if (e.CancelMode == ListViewCancelMode.CancelingEdit)
            {
                //e.Cancel = true;
                lvDepartment.EditIndex = -1;
                BindData();