kannan T
how to get the edit mode in c# dot net datagridview
By kannan T in ASP.NET on May 23 2009
  • Rahul Kumar Saxena
    May, 2009 27
  • jayesh patel
    May, 2009 25

      To get edit mode in c# .net datagridview write the following code.

         protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            GridView1.EditIndex = e.NewEditIndex;
            bindgrid();
        }

    void bindgrid()
        {
            cn = new SqlConnection(ConfigurationManager.ConnectionStrings[1].ConnectionString);
            cn.Open();
            SqlCommand cmd = new SqlCommand("select * from stud", cn); // stud is a table name.
            SqlDataReader dr = cmd.ExecuteReader();
            GridView1.DataSource = dr;
            GridView1.DataBind();
        }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS