Setting a CheckboxC...
Clear all

Setting a CheckboxColumn in code


Topic starter

Hi, I parsing a JSONItem and need to set the valve of a checkbox to checked or unchecked, but I can't seem to find the correct way to do this, 

The Column (col) is defined with


I've tried

These Error with Errors with There is more than one item with this name and it's not clear to which this refers.

DataView1.CellCheck( row, col, 1) 

DataView1.CellCheck( row, col, CheckBox.CheckedStates.Checked)

DataView1.Cell(row, col) = DataView1.CellState( row, col, CheckBox.CheckBoxUnchecked)

DataView1.Cell(row, col) = piDogDataView.DataView.CellState( row, col, CheckBox.CheckBoxChecked)

DataView1.Cell(row, col, CheckBox.CheckedStates.Checked )


this one doesn't error but doesn't tick the check box

DataView1.Cell(row, col) = CheckBox.CheckedStates.Checked

I'd be really grateful for a little help,

thank you

I'm sure I tried this before, but a new day with fresh eyes
thank you

Topic Tags
1 Answer

Hi Sarah,

Glad you found the solution!

Another way would be to set 


You can also browse the DataView class inside: DataView_Folder/piDogDataView_Folder/piDogDataView/Classes/DataView




ooh thats so much neater and quicker 🙂
What I was doing was to wrap the JSONItem value in an if else statement like below, now I don't, I can use 1 line. I've posted it just incase someone else as dumb as me is struggling 🙂

( optionItem is the JSON Item and I'm looping through them to find specific names to do specific things with)

Instead of
If optionItem.Value("Active") = 1 Then
'End If
thank you so much