• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GridViewUpdateEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GridViewUpdateEventArgs的典型用法代码示例。如果您正苦于以下问题:C# GridViewUpdateEventArgs类的具体用法?C# GridViewUpdateEventArgs怎么用?C# GridViewUpdateEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GridViewUpdateEventArgs类属于命名空间,在下文中一共展示了GridViewUpdateEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string sno = (GridView1.Rows[e.RowIndex].Cells[3].Controls[0] as TextBox).Text;
        string sname = (GridView1.Rows[e.RowIndex].Cells[4].Controls[0] as TextBox).Text;
        string ssex = (GridView1.Rows[e.RowIndex].Cells[5].Controls[0] as TextBox).Text;
        string sage = (GridView1.Rows[e.RowIndex].Cells[6].Controls[0] as TextBox).Text;
        string sdept = (GridView1.Rows[e.RowIndex].Cells[7].Controls[0] as TextBox).Text;
        using (
            SqlConnection connection =
                new SqlConnection(connectionString))
        {
            string commanText =
                string.Format("UPDATE Student SET Sname = '{0}', Ssex = '{1}', Sage = '{2}', Sdept = '{3}' WHERE Sno = '{4}'", sname,
                    ssex, sage, sdept, sno);
            var command = new SqlCommand(commanText, connection);
            if (connection.State != ConnectionState.Open)
            {
                connection.Open();
            }
            command.ExecuteNonQuery();
            GridView1.EditIndex = -1;
            BindGridView();

        }
    }
开发者ID:ningboliuwei,项目名称:Course_ASPNET,代码行数:25,代码来源:GridViewEditor.aspx.cs


示例2: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        var List = new List<Student_Registration_Form>();

        var db = new DataClassesDataContext();

        string _accountType, _email, _contactMethod, _campus, _faculty, _course;
        int _phone, _mobile;

        _accountType = ((TextBox) (GridView1.Rows[e.RowIndex].FindControl("textAccType"))).Text;
        _email = ((TextBox) (GridView1.Rows[e.RowIndex].FindControl("textEmail"))).Text;
        //_citizenship = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("Marital_Status"))).Text;
        _contactMethod = ((TextBox) (GridView1.Rows[e.RowIndex].FindControl("textContact"))).Text;
        _campus = ((TextBox) (GridView1.Rows[e.RowIndex].FindControl("textCampus"))).Text;
        _faculty = ((TextBox) (GridView1.Rows[e.RowIndex].FindControl("textFaculty"))).Text;
        _course = ((TextBox) (GridView1.Rows[e.RowIndex].FindControl("textCourse"))).Text;
        //_phone = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl.("textPhone"))).ToString();
        //_mobile = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("textMobile"))).Text;

        var update = (from u in db.Student_Registration_Forms
            where u.Accomodition_Type == _accountType
            where u.Email == _email
            //where u.Marital_Status == _citizenship
            where u.Contact == _contactMethod
            where u.campus == _campus
            where u.Faculty == _faculty
            where u.Courses == _course
            select u);


        GridView1.DataSource = List;
        db.SubmitChanges();
        BindGrid();
    }
开发者ID:KeilCarpenter,项目名称:StudentFinancialServices-WinForms-,代码行数:34,代码来源:SearchStudent.aspx.cs


示例3: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int _selectedRowIndex = e.RowIndex;
           // HiddenField hidden = (HiddenField)
        int projID = (int)GridView1.DataKeys[_selectedRowIndex].Values[2];
        int rowIndex = GridView1.SelectedIndex;
          //  int projID = Convert.ToInt32( GridView1.DataKeys[rowIndex].Values[2]);
           // int projID = 4;
        TextBox txtForMark = (TextBox)(GridView1.Rows[e.RowIndex].FindControl("theMarkTextBox"));
        string newMark = txtForMark.Text.ToString();
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        try
        {
          //  con.Open();
            string upDate = "UPDATE StudentsProjects SET mark=" + newMark + " WHERE projectID=" + projID + " ";
          //  SqlCommand updateCommand = new SqlCommand(upDate, con);
          //  updateCommand.CommandType = CommandType.Text;
           // updateCommand.ExecuteNonQuery();
           // con.Close();
           // SqlDataSource1.Update();
            SqlDataSource1.UpdateCommand = upDate;
          //  GridView1.DataSource = SqlDataSource1;

          //  GridView1.DataBind();
        }
        catch { }
        //SqlDataSource1.Update();
    }
开发者ID:ksksAsa,项目名称:aepTrain1,代码行数:28,代码来源:ProjectsByStudents.aspx.cs


示例4: gv_weddingCustomer_RowUpdating

    protected void gv_weddingCustomer_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridViewRow row = (GridViewRow)gv_weddingCustomer.Rows[e.RowIndex];
        Label lblCustomerID = (Label)row.FindControl("lblid");
        Label lblSalutation = (Label)row.FindControl("lblid1");
        TextBox textFname = (TextBox)row.FindControl("textbox1");
        TextBox textLname = (TextBox)row.FindControl("textbox2");
        TextBox textstate_Address = (TextBox)row.FindControl("textbox3");
        TextBox textCity = (TextBox)row.FindControl("textbox4");
        TextBox textPostelCode = (TextBox)row.FindControl("textbox5");
        TextBox textPhone = (TextBox)row.FindControl("textbox6");
        TextBox textEmail = (TextBox)row.FindControl("textbox7");

        TextBox textCountry = (TextBox)row.FindControl("textbox8");
        TextBox textPassport_num = (TextBox)row.FindControl("textbox9");

        gv_weddingCustomer.EditIndex = -1;
        String customerUpdateQuery = "update Customer set fname = '" + textFname.Text + "',lname = '" + textLname.Text + "' where CustomerID = " + lblCustomerID.Text + " ";

        bool updateResult = dc.insert(customerUpdateQuery);

        lblUpdateMsg.Visible = true;
        if (updateResult == true)
        {
            lblUpdateMsg.Text = "Details of Customer with ID '" + lblCustomerID.Text + "' was sucessly updated!";
        }
        else
        {
            lblUpdateMsg.Text = "Sorry!Unable to be update Details of Customer with ID '" + lblCustomerID.Text + "'!";
        }
        fillGrid();
    }
开发者ID:LalithaPriyadarshani,项目名称:Hotel-Management-System,代码行数:32,代码来源:weddingCustomer.aspx.cs


示例5: GrdLoadJobCompany_RowUpdating

    protected void GrdLoadJobCompany_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int indexrow = e.RowIndex;
        string tid = ((Label)GrdLoadJobCompany.Rows[indexrow].FindControl("PostJobId")).Text;

        Response.Redirect("~/ShowJobDetails.aspx?PostJobId=" + tid);
    }
开发者ID:riteshdamedhar,项目名称:DevgiriRepo,代码行数:7,代码来源:ShowJobByCompany.aspx.cs


示例6: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox my_MaterialName, my_PurchaseUnit, my_ConsumeUnit, my_ConversionFactor, my_MaterialSafeQuantity, my_MaterialTypeID, my_MaterialUnit, my_Active;

        String my_NO = gv.DataKeys[e.RowIndex].Value.ToString();
        my_MaterialName = (TextBox)gv.Rows[e.RowIndex].Cells[2].Controls[0];
        my_PurchaseUnit = (TextBox)gv.Rows[e.RowIndex].Cells[3].Controls[0];
        my_ConsumeUnit = (TextBox)gv.Rows[e.RowIndex].Cells[4].Controls[0];
        my_ConversionFactor = (TextBox)gv.Rows[e.RowIndex].Cells[5].Controls[0];
        my_MaterialSafeQuantity = (TextBox)gv.Rows[e.RowIndex].Cells[6].Controls[0];
        my_MaterialTypeID = (TextBox)gv.Rows[e.RowIndex].Cells[7].Controls[0];
        my_MaterialUnit = (TextBox)gv.Rows[e.RowIndex].Cells[8].Controls[0];
        my_Active = (TextBox)gv.Rows[e.RowIndex].Cells[9].Controls[0];

        //檢查更新是否成功
        if (UpdateICS_Material(my_NO, my_MaterialName, my_PurchaseUnit, my_ConsumeUnit, my_ConversionFactor, my_MaterialSafeQuantity, my_MaterialTypeID, my_MaterialUnit, my_Active))
        {
            ShowMsg2(UpdatePanel1, "更新成功");
        }
        else 
        {
            ShowMsg2(UpdatePanel1, "更新失敗");
        }

        gv.EditIndex = -1;
        InitData();
        SearchData();
    }
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:28,代码来源:Inventory_AQM.aspx.cs


示例7: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int postid = 0;
        string postcontent = "";
        DateTime modified = DateTime.Now;
        string poststatus = "";
        int rating = 0;

        postid = Convert.ToInt16(((Label)GridView1.Rows[e.RowIndex].FindControl("lblpostid")).Text);
        postcontent = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtPostContent")).Text;
        poststatus = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus")).Text;
        rating = Convert.ToInt16(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtrating")).Text);

        PostBLL pb = new PostBLL();
           int i= pb.UpdatePost(postid,postcontent,modified,poststatus,rating);
           if (i == 1)
           {
           Response.Write("<script language='javascript'>alert('Post has been updated !');</script>");
           GridView1.DataBind();
           }
           else
           {
           Response.Write("<script language='javascript'>alert('Post is failed to be updated !');</script>");
           GridView1.DataBind();
           }
    }
开发者ID:njain006,项目名称:CodeSense,代码行数:26,代码来源:AdminPost.aspx.cs


示例8: GvOrder_RowUpdating

    protected void GvOrder_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int i = e.RowIndex;

        DataRow rOrder = TableOrder.Rows[i];

        GridViewRow row = GvOrder.Rows[e.RowIndex];

        double f = -1;
        double.TryParse(((TextBox)(row.Cells[1].Controls[0])).Text,out f);

        int quant = (int)f;
        if (quant < 0) return;

        string s = (string)rOrder[4];

        if (s[0] > '9' || s[0] <= '0')
        {
            //get rid of "$"
            s = s.Substring(1);
        }

        rOrder["SubPrice"] = (Convert.ToDouble(s) * quant).ToString("C");

        rOrder["Quantity"] = quant;

        GvOrder.EditIndex = -1;

        Update();
    }
开发者ID:wuyongqiang,项目名称:WebDevAssgn,代码行数:30,代码来源:GvOrder.ascx.cs


示例9: gridViewFarms_RowUpdating

 protected void gridViewFarms_RowUpdating(object sender,
     GridViewUpdateEventArgs e)
 {
     GridViewRow row = gridViewFarms.Rows[e.RowIndex];
     try
     {
         sqlConnection.Open();
         SqlCommand cmd = sqlConnection.CreateCommand();
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "UpdateNotes";
         cmd.Parameters.Add("@VillageCoordinates", SqlDbType.Int).Value = ((TextBox) row.Cells[0].Controls[0]).Text;
         cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value = ((TextBox) row.Cells[7].Controls[0]).Text;
         cmd.ExecuteNonQuery();
     }
     catch (SqlException ex)
     {
         LabelStatus.Text = ex.ToString();
     }
     finally
     {
         sqlConnection.Close();
     }
     gridViewFarms.EditIndex = -1;
     PopulateGridView();
 }
开发者ID:trippleflux,项目名称:jezatools,代码行数:25,代码来源:Main.aspx.cs


示例10: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            UserDetails userDetails = new UserDetails();

            userDetails.userID = GridView1.Rows[e.RowIndex].Cells[0].Text;
            userDetails.firstName = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text;
            userDetails.lastName = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text;
            userDetails.phone = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text;
            userDetails.cityID = int.Parse(((DropDownList)(GridView1.Rows[e.RowIndex].Cells[3].FindControl("DropDownList1"))).SelectedValue);
            userDetails.address = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[6].FindControl("TextBox1"))).Text;
            userDetails.state = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[6].FindControl("TextBox3"))).Text;
            userDetails.zipCode = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[6].FindControl("TextBox2"))).Text;
            

            UserService userService = new UserService();
            userService.UpdateUserDetails(userDetails);

            GridView1.EditIndex = -1;
            populateGrid();
        }
        catch (Exception ex)
        {
            Label1.Text = ex.Message;
        }
    }
开发者ID:yanoovoni,项目名称:Rdroid,代码行数:27,代码来源:UserManagmnent.aspx.cs


示例11: gridStudent_RowUpdating

    protected void gridStudent_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        SqlConnection connection = SqlHelper.GetConnection();
        var dataAdapter = new SqlDataAdapter(selectCommandText, connection);
        var builder = new SqlCommandBuilder(dataAdapter);
        dataAdapter.DeleteCommand = builder.GetDeleteCommand();
        DataSet dataSet = SqlHelper.GetDataSetBySqlCommand(selectCommandText, connection);

        string studentID = (gridStudent.Rows[e.RowIndex].Cells[1].Controls[0] as TextBox).Text;
        string name = (gridStudent.Rows[e.RowIndex].Cells[2].Controls[0] as TextBox).Text;
        string gender = (gridStudent.Rows[e.RowIndex].Cells[3].Controls[0] as TextBox).Text;
        string dayOfBirth = (gridStudent.Rows[e.RowIndex].Cells[4].Controls[0] as TextBox).Text;
        string address = (gridStudent.Rows[e.RowIndex].Cells[5].Controls[0] as TextBox).Text;
        string department = (gridStudent.Rows[e.RowIndex].Cells[6].Controls[0] as TextBox).Text;

        //获取 DataSet 中与点击了 “编辑” 按钮的这行对应的数据行
        DataRow row = dataSet.Tables[0].Rows[e.RowIndex];
        //修改其中各字段的值
        row["StudentID"] = studentID;
        row["Name"] = name;
        row["Gender"] = gender;
        row["DayOfBirth"] = dayOfBirth;
        row["Address"] = address;
        row["Department"] = department;

        //提交到数据库中
        dataAdapter.Update(dataSet);
        gridStudent.EditIndex = -1;
        ShowData();
    }
开发者ID:ningboliuwei,项目名称:Course_ASPNET,代码行数:30,代码来源:StudentList.aspx.cs


示例12: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridViewRow gvr = this.GridView1.Rows[this.GridView1.EditIndex];
        DropDownList ddl = (DropDownList)gvr.Cells[9].FindControl("DropDownList1");

        e.NewValues["Type"] = ddl.SelectedValue;
    }
开发者ID:getfirstblood,项目名称:course-website,代码行数:7,代码来源:ExamManager.ascx.cs


示例13: UserAccounts_RowUpdating

    protected void UserAccounts_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Guid id = (Guid)e.Keys[0];
        GridViewRow row = UserAccounts.Rows[e.RowIndex];
        string fullname = (row.FindControl("txtFullname") as TextBox).Text;
        string email = (row.FindControl("txtEmail") as TextBox).Text;
        string phone = (row.FindControl("txtPhone") as TextBox).Text;
        string comment = (row.FindControl("txtComment") as TextBox).Text;

        bool isApproved = (row.FindControl("chkIsApproved") as CheckBox).Checked;

        MembershipUser user = Membership.GetUser(id);

        if (user == null) return;

        user.Email = email;
        user.Comment = comment;
        user.IsApproved = isApproved;

        Membership.UpdateUser(user);

        aspnet_UserProfilesBLL bll = new aspnet_UserProfilesBLL();
        bll.UpdateProfile(user.UserName, fullname, phone);

        //LinqDataSource1.DataBind();
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:26,代码来源:ManageUser.aspx.cs


示例14: AdminDoctorView_RowUpdating

 protected void AdminDoctorView_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     BusinessLayer businessLyerObj = new BusinessLayer();
     string connectString = ConfigurationManager.AppSettings.Get("connString");
     int index = e.RowIndex;
     businessLyerObj.ApproveDoctor(AdminDoctorView.DataKeys[index].Value.ToString(), connectString);
 }
开发者ID:san2488,项目名称:medicopedia,代码行数:7,代码来源:AdminHome.aspx.cs


示例15: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        //Get the CheckBox in the row that is being updated
        CheckBox adminbox = (CheckBox)GridView1.Rows[e.RowIndex].FindControl("CheckBox1");

        //Get the User
        string username = GridView1.Rows[e.RowIndex].Cells[0].Text;

        //get the username from the datakeys collection instead
        //string username1 = GridView1.DataKeys[e.RowIndex].Value.ToString();

        //if the checkbox is checked and the user is not currently an admin, add the user to the admin role
        if(adminbox.Checked && Roles.IsUserInRole(username,"Admin"))
        {
            Roles.AddUserToRole(username, "Admin");
        }

        //if the checkebox is unchecked and the user is currently an admin, remove the user from the Admin role
        if(!adminbox.Checked && Roles.IsUserInRole(username, "Admin"))
        {
            Roles.RemoveUserFromRole(username, "Admin");
        }

        GridView1.EditIndex = -1;
        GridView1.DataBind();
    }
开发者ID:anhany,项目名称:fa15-mis5050-Repository,代码行数:26,代码来源:Admin.aspx.cs


示例16: gvMappedInstruments_RowUpdating

    protected void gvMappedInstruments_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            GridViewRow editingRow = (gvMappedInstruments.EditIndex >= 0 ? gvMappedInstruments.Rows[gvMappedInstruments.EditIndex] : null);
            if (editingRow != null)
            {
                DropDownList ddlAssetClass = (DropDownList)Utility.FindControl(editingRow, "ddlAssetClass");
                DropDownList ddlRegionClass = (DropDownList)Utility.FindControl(editingRow, "ddlRegionClass");
                DropDownList ddlInstrumentsCategories = (DropDownList)Utility.FindControl(editingRow, "ddlInstrumentsCategories");
                DropDownList ddlSectorClass = (DropDownList)Utility.FindControl(editingRow, "ddlSectorClass");
                DecimalBox dbMaxWithdrawalAmountPercentage = (DecimalBox)Utility.FindControl(editingRow, "dbMaxWithdrawalAmountPercentage");

                e.NewValues["assetClassId"] = Convert.ToInt32(ddlAssetClass.SelectedValue);
                e.NewValues["regionClassId"] = Convert.ToInt32(ddlRegionClass.SelectedValue);
                e.NewValues["instrumentsCategoryId"] = Convert.ToInt32(ddlInstrumentsCategories.SelectedValue);
                e.NewValues["sectorClassId"] = Convert.ToInt32(ddlSectorClass.SelectedValue);
                e.NewValues["maxWithdrawalAmountPercentage"] = dbMaxWithdrawalAmountPercentage.Value;
            }
        }
        catch (Exception ex)
        {
            e.Cancel = true;
            lblErrorMessage.Text = Utility.GetCompleteExceptionMessage(ex);
        }
    }
开发者ID:kiquenet,项目名称:B4F,代码行数:26,代码来源:AssetManagerInstrumentSelection.aspx.cs


示例17: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string cname, c_add, city, desig, j_date, salary, c_per_name, c_per_no, sid;
        cname = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox3"))).Text;
        c_add = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox4"))).Text;
        city = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox5"))).Text;
        desig = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox6"))).Text;
        j_date = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox7"))).Text;
        salary = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox8"))).Text;
        c_per_name = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox9"))).Text;
        c_per_no = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox10"))).Text;
        sid = GridView1.DataKeys[e.RowIndex].Value.ToString();

        SqlDataSource5.UpdateParameters["cname"].DefaultValue = cname;
        SqlDataSource5.UpdateParameters["c_add"].DefaultValue = c_add;
        SqlDataSource5.UpdateParameters["city"].DefaultValue = city;
        SqlDataSource5.UpdateParameters["desig"].DefaultValue = desig;
        SqlDataSource5.UpdateParameters["j_date"].DefaultValue = j_date;
        SqlDataSource5.UpdateParameters["salary"].DefaultValue = salary;
        SqlDataSource5.UpdateParameters["c_per_name"].DefaultValue = c_per_name;
        SqlDataSource5.UpdateParameters["c_per_no"].DefaultValue = c_per_no;
        SqlDataSource5.UpdateParameters["sid"].DefaultValue = sid;
        SqlDataSource5.Update();
        GridView1.EditIndex = -1;
        GridView1.DataBind();
    }
开发者ID:hpie,项目名称:hpie,代码行数:26,代码来源:placement_view.aspx.cs


示例18: gridViewIssueMaintenance_OnRowUpdating

    protected void gridViewIssueMaintenance_OnRowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        // Check for New Row
        if (Convert.ToString(e.Keys["IssueID"]) == "")
        {
            // --------------- //
            // Transfer Values //
            // --------------- //

            // Issue
            if (e.NewValues["Issue"] != null) { hiddenFieldIssue.Value = Convert.ToString(e.NewValues["Issue"].ToString()); };

            // IssueDescription
            if (e.NewValues["IssueDescription"] != null) { hiddenFieldIssueDescription.Value = Convert.ToString(e.NewValues["IssueDescription"].ToString()); };

            // IssueLevelID
            if (e.NewValues["IssueLevelID"] != null) { hiddenFieldIssueLevelID.Value = Convert.ToString(e.NewValues["IssueLevelID"].ToString()); };

            // IssueStatusID
            if (e.NewValues["IssueStatusID"] != null) { hiddenFieldIssueStatusID.Value = Convert.ToString(e.NewValues["IssueStatusID"].ToString()); };

            // Notes
            if (e.NewValues["Notes"] != null) { hiddenFieldNotes.Value = Convert.ToString(e.NewValues["Notes"].ToString()); };

            // New Row - Insert
            objectDataSourceIssue.Insert();

            // Reload Page
            Response.Redirect(Request.RawUrl);
        }
    }
开发者ID:HenrikKristensen,项目名称:DMS,代码行数:31,代码来源:SecureAdminIssueMaintenance_New.aspx.cs


示例19: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        //获取编辑状态下当前行中每一列的值
        //当 GridView 中的某一行处于编辑状态时,可以看成是某个单元格中放置了一个 TextBox 控件
        //所以需要得到这个 TextBox 控件,并获取其中的文本
        string sno = (GridView1.Rows[e.RowIndex].Cells[3].Controls[0] as TextBox).Text;
        string sname = (GridView1.Rows[e.RowIndex].Cells[4].Controls[0] as TextBox).Text;
        string ssex = (GridView1.Rows[e.RowIndex].Cells[5].Controls[0] as TextBox).Text;
        string sage = (GridView1.Rows[e.RowIndex].Cells[6].Controls[0] as TextBox).Text;
        string sdept = (GridView1.Rows[e.RowIndex].Cells[7].Controls[0] as TextBox).Text;

        //获取 DataSet 中与点击了 “编辑” 按钮的这行对应的数据行
        DataRow row = dataSet.Tables[0].Rows[e.RowIndex];
        //修改其中各字段的值
        row["Sno"] = sno;
        row["Sname"] = sname;
        row["Ssex"] = ssex;
        row["Sage"] = sage;
        row["Sdept"] = sdept;

        //提交到数据库中
        dataAdapter.Update(dataSet);
        GridView1.EditIndex = -1;
        BindGridView();
    }
开发者ID:ningboliuwei,项目名称:Course_ASPNET,代码行数:25,代码来源:GridViewEditor2.aspx.cs


示例20: GridView1_RowUpdating

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        SQLDB db = new SQLDB();
        string deviceKind = gv.Rows[e.RowIndex].Cells[1].Text;
        TextBox checkcycle;
        checkcycle = (TextBox)gv.Rows[e.RowIndex].Cells[2].Controls[0];

        if (!IsNumeric(checkcycle.Text))
        {
            ShowMsg2(UpdatePanel1, "請輸入數字");
            return;
        }

        //檢查更新是否成功
        string updatestring = "Update  CD_CheckCycle set cycle= '" + checkcycle.Text + "'  where Devicekind = '" + deviceKind + "'";
        if (db.ExecuteStatement(updatestring))
        {
            ShowMsg2(UpdatePanel1, "更新成功");
        }
        else
        {
            ShowMsg2(UpdatePanel1, "更新失敗");
        }

        gv.EditIndex = -1;
        InitData();
        SearchData();
    }
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:28,代码来源:App_Web_jkbqqdxf.3.cs



注:本文中的GridViewUpdateEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GridViewUpdatedEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# GridViewSortEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap