漫漫技术人生路

C#

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        if (e.CommandName == "Edit")
        {
            DetailsView1.ChangeMode(DetailsViewMode.Edit);
            CommandField dd = new CommandField();
            dd.EditText = "Edit";
            dd.UpdateText = "Update";
            dd.CancelText = "Cancel";
            DetailsView1.AutoGenerateEditButton = true;
        }

        if (e.CommandName == "Cancel")
        {
            DetailsView1.AutoGenerateEditButton = false;
        }
    }


  protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {
        DetailsView1.AutoGenerateEditButton = false;
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        DetailsView1.Visible = false;
    }

posted on 2006-10-25 14:46  javaca88  阅读(630)  评论(0编辑  收藏  举报