Update cell value in Datagridview in C #

1

Hello

When I click a button, I need to update the value of a cell in datagridview .

Follow the code that I tried but did not work.

  private void btnAcesso_Click(object sender, EventArgs e)
    {
        foreach (DataGridViewRow item in dgvLista.SelectedRows)
        {
            dgvLista.Rows[item.Index].Cells["acesso"].Value = "S";
        }
    }

You have to upgrade from the selected line.

Note: Enter foreach but does not update.

Thank you.

Filling the grid:

 var source = new BindingSource();
            source.DataSource = lstMenuAux;
            dgvLista.DataSource = source;
    
asked by anonymous 17.06.2016 / 21:02

0 answers