问个很低级的问题.哈哈
拖一个GV 中自带的编辑项 在事件中GridView_RowEditing事件中如何写?要是哪个有例子正好复制一个上来更好.应该挺简单的,我忘了!

解决方案 »

  1.   

    void CustomersGridView_RowEditing(Object sender, GridViewEditEventArgs e)
      {
        
        // Get the country for the row being edited. For this example, the
        // country is contained in the seventh column (index 6). 
        String country = CustomersGridView.Rows[e.NewEditIndex].Cells[6].Text;    // For this example, cancel the edit operation if the user attempts
        // to edit the record of a customer from the Unites States. 
        if (country == "USA")
        {
          // Cancel the edit operation.
          e.Cancel = true;
          Message.Text = "You cannot edit this record.";
        }
        else
        {
          Message.Text = "";
        }
        
      }
      

  2.   

    Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
            GridView1.EditIndex = e.NewEditIndex
            'Call gridview1_databind()        TextBox1.Text = GridView1.Rows(e.NewEditIndex).Cells(1).Text.ToString
            Call gridview1_databind()    End Sub