Datagridview
-
Hi all I'm using datagridview with vb.net, I have a CHECKBOX COLUMN then I fill it I use CellContentClick event that when the user change the CHECKBOX COLUMN vlue then do ......... something what is happened, when the user change CHECKBOX COLUMN value the CellContentClick is firing , for eg: CHECKBOX COLUMN value before click = true after click will be = false when I go to get it's value
Dim chk As Boolean
chk = MyDataGridView.CurrentRow.Cells("Col_Check").Value)it's still keeping its orginal value (True) it's saving the new value after you change the row if any one can help thank you
jooooo
-
Hi all I'm using datagridview with vb.net, I have a CHECKBOX COLUMN then I fill it I use CellContentClick event that when the user change the CHECKBOX COLUMN vlue then do ......... something what is happened, when the user change CHECKBOX COLUMN value the CellContentClick is firing , for eg: CHECKBOX COLUMN value before click = true after click will be = false when I go to get it's value
Dim chk As Boolean
chk = MyDataGridView.CurrentRow.Cells("Col_Check").Value)it's still keeping its orginal value (True) it's saving the new value after you change the row if any one can help thank you
jooooo
-
Hi all I'm using datagridview with vb.net, I have a CHECKBOX COLUMN then I fill it I use CellContentClick event that when the user change the CHECKBOX COLUMN vlue then do ......... something what is happened, when the user change CHECKBOX COLUMN value the CellContentClick is firing , for eg: CHECKBOX COLUMN value before click = true after click will be = false when I go to get it's value
Dim chk As Boolean
chk = MyDataGridView.CurrentRow.Cells("Col_Check").Value)it's still keeping its orginal value (True) it's saving the new value after you change the row if any one can help thank you
jooooo
I'll have a look at my code over the week end or Monday. I think I have a working example. GER
Ger
-
Hi all I'm using datagridview with vb.net, I have a CHECKBOX COLUMN then I fill it I use CellContentClick event that when the user change the CHECKBOX COLUMN vlue then do ......... something what is happened, when the user change CHECKBOX COLUMN value the CellContentClick is firing , for eg: CHECKBOX COLUMN value before click = true after click will be = false when I go to get it's value
Dim chk As Boolean
chk = MyDataGridView.CurrentRow.Cells("Col_Check").Value)it's still keeping its orginal value (True) it's saving the new value after you change the row if any one can help thank you
jooooo
Here is how I use the checkbox column in a DataGridView using C++/CLI. I load my datagrid launching my forms. In my RowEntered function I dislay the value of the checkbox from the grid in a static region of the screen. I am currently using a try/catch construct.
try { chkRegistered->Checked = (bool)gridPerson->Rows\[e->RowIndex\]->Cells\[dgRegistered->Index\]->Value; } catch(Exception ^e) { chkRegistered->Checked = false; }
I have also used (but since stopped) an if statement for this purpose.
if (gridPerson->Rows\[e->RowIndex\]->Cells\[9\]->Value == true) chkRegistered->Checked = true; else chkRegistered->Checked = false;
This is an extract from the CellValueChanged Event where I capture the checkbox value for storage:
case 9: { chkRegistered->Checked = safe\_cast<bool>(gridPerson->Rows\[e->RowIndex\]->Cells\[9\]->Value); m\_ElementList = m\_ElementList | m\_FlagBits::REGISTERED; break; }
One last thing, have a look at the code converters from www.tangiblesoftwaresolutions.com - I use them to convert snippets from VB and C# to C++ for my use. Regards
Ger