DataGridViewCheckBoxColumn not work

0
0

Hello!

I Have an aplication in vb.net and i want edit a boolean value in the datagridview, but not work. I have readonly = false and i can´t edit the CheckBoxColumn, the value is not assigned. Show the example, in the Column0 i can modify, but Column1 not!!

Help me please!!

 

Attachment
  • You must to post comments
0
0

Hi Carina,

looking at your code it seems that you are missing to bind Column1 to the datasource member.
Can you please also share how/where you define the bindings for the DGV columns ?

I have created a small sample (in C#) like this:

this.dataGridView1.Columns[“colText”].DataPropertyName = “Text”;
this.dataGridView1.Columns[“colCheck”].DataPropertyName = “Check”;

this.dataGridView1.AutoGenerateColumns = false;

DataTable dt = new DataTable();
dt.Columns.Add(“Text”, typeof(string));
dt.Columns.Add(“Check”, typeof(bool));

dt.Rows.Add(“Text1”, true);
dt.Rows.Add(“Text2”, false);
dt.Rows.Add(“Text3”, true);

this.dataGridView1.DataSource = dt;

dt.Rows[1][“Check”] = true;

Also, there is no need to assign the datasource a 2nd time as this does not perform any update.

Best regards
Frank

  • You must to post comments
0
0

Hi Frank!

My code is :

gridSolicitudes.AutoGenerateColumns = False
dtDatos = AbrirDataTable(“SELECT * FROM IMPORTACIONES”)
dtDatos.Columns.Add(“Seleccionar”, Type.GetType(“System.Boolean”))
For Each dr As DataRow In dtDatos.Rows
dr(“Seleccionar”) = False
Next
gridSolicitudes.DataSource = dtDatos

And here change status colums bool :

If gridSolicitudes.Rows.Count > 0 Then

For Each dr As DataRow In dtDatos.Rows
dr(“Seleccionar”) = CBool(True)
Next

End If
gridSolicitudes.DataSource = dtDatos

 

Thanks for your help!

 

  • You must to post comments
0
0

Hi Carina,

thanks for your message. Did you try with the latest Wisej rölease (1.4.50) ?

If you did, can you please share some code that you have been using ? Is your DataGridView bound to a DataSource ?
If you don´t want to post here, you can also send it to frankATiceteagroup.com

Thanks in advance !

Best regards
Frank

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.