Chekbox column in datagridview

Asked

Viewed 31 times

0

I’m getting an error after I put a chekbox column in the datagridview on my screen, and this screen is loaded by a query, put this chekbox column not in the query but directly in the datagridview.inserir a descrição da imagem aqui

follows the code

private void ListaGrid()
    {
        try
        {
            SqlCommand separacao = new SqlCommand("usp_SeparacaoPic", conexaoDADOADV(true));
            separacao.CommandType = CommandType.StoredProcedure;
            separacao.ExecuteNonQuery();

            SqlDataAdapter dados = new SqlDataAdapter(separacao);
            DataTable dtLista = new DataTable();
            dados.Fill(dtLista);

            dgw_separacaopic.DataSource = dtLista;

        }
        catch
        {
            MessageBox.Show("Não exstem dados digitados para a consulta, por favor verificar!!!");
            return;
        }
    }

Thanks in advance.

  • It does not have the value in the list you are sending, so the problem or the type you are sending is not boolean (true or false), which is being sent?

  • Virgilio thanks for answering, but in the column I am not passing any value, I only created the column in datagridview, and I did not configure anything in it.

  • 1

    when you do dgw_separacaopic.DataSource = dtLista; that column needs a value

  • Virgilio you can explain to me how I value the column ??

  • 1

    bring a default value to your Storedprocedure usp_SeparacaoPic

  • Virgilio understood, I will do here thank you very much.

  • 1

    Worked out here thanks.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.