Skip to main content

Checkbox in DataGridView

  • January 21, 2016
  • 8 replies
  • 0 views

I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

8 replies

I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Oi Wagner, tudo bom?

Você está trabalhando com WFA, WPF ou Asp.Net? Que tipo de ação vc precisa fazer? Está relacionado à algum evento?

Hi Wagner, how are you?

Are you working with WFA, WPF or Asp.net? What do you need to do with checkbox? is it related to an event?


  • January 21, 2016

I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

WFA - Windows Form Application


I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Oi Pita,

Tente usar desta forma / Try to use this way:

try
    set lo-ativo to self::GridListar::Rows::Item(lo-ind)::Cells::Item(0)::Value
catch
    move spaces to lo-ativo
finally
    *> finally code
    if lo-ativo equals "True"
        *> Perform here the action you want to do.
        *> Faça aqui a ação que precisar
    end-if

Onde / Where:

lo-ativo = pic x(04) or boolean
GridListar = Nome do Objeto DataGrid / Name of the DataGrid Object
item(lo-ind) = Índice da linha / Row index
lo-ind = pic 9(03)
item(0) = Índice da coluna / Column Index

Os valores esperados são "True" quando marcado e "False" quando não estão marcados.
The values from the checkbox are "True" when checked and "False" when unchecked.

Espero que lhe ajude / Hope this helps.

Coral


  • January 22, 2016

I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Eu havia chego nesta solução com algumas poucas variações o problema e saber qual a ação para que quando eu marcar o checkbox ele por exemplo bloquei uma coluna.


I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Oi Pita. Eu uso assim no WFA:

             method-id dataGridView1_CellContentClick final private.

             declare myChk as condition-value = type Convert::ToBoolean(dataGridView1::Rows[e::RowIndex]::Cells["NomeColuna"]::EditedFormattedValue)

             if myChk

                set dataGridView1::Columns(0)::Frozen = True

             end-if

Hi Pita, I use this in the WFA:

   method-id dataGridView1_CellContentClick final private.

             declare myChk as condition-value = type Convert::ToBoolean(dataGridView1::Rows[e::RowIndex]::Cells["Column Name"]::EditedFormattedValue)

             if myChk

                set dataGridView1::Columns(0)::Frozen = True

             end-if


I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Oi Pita. Eu uso assim no WFA:

             method-id dataGridView1_CellContentClick final private.

             declare myChk as condition-value = type Convert::ToBoolean(dataGridView1::Rows[e::RowIndex]::Cells["NomeColuna"]::EditedFormattedValue)

             if myChk

                set dataGridView1::Columns(0)::Frozen = True

             end-if

Hi Pita, I use this in the WFA:

   method-id dataGridView1_CellContentClick final private.

             declare myChk as condition-value = type Convert::ToBoolean(dataGridView1::Rows[e::RowIndex]::Cells["Column Name"]::EditedFormattedValue)

             if myChk

                set dataGridView1::Columns(0)::Frozen = True

             end-if


I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Oi Pita, veja por favor se o exemplo em anexo responde a sua dúvida
http://community.microfocus.com/microfocus/cobol/visual_cobol/f/18/t/13125.aspx
Observação: Usa exatamente a mesma solução do Altair.

Hi Pita, please, look into the following sample to see if answers your questions.
http://community.microfocus.com/microfocus/cobol/visual_cobol/f/18/t/13125.aspx
Obs: It is using the same solution that Altair posted. 


  • January 26, 2016

I'm needing to treat a checkbox in datagridview but I can not, can someone help me with this. Thanks!

Pessoal obrigado pela ajuda