# Changing columns attributes of a table via python

**URL:** <https://forum.inductiveautomation.com/t/changing-columns-attributes-of-a-table-via-python/4200>\
**Category:** Ignition\
**Created:** [March 23, 2012, 10:41am UTC](https://forum.inductiveautomation.com/t/changing-columns-attributes-of-a-table-via-python/4200 "2012-03-23T10:41:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [March 23, 2012, 10:41am UTC](https://forum.inductiveautomation.com/t/changing-columns-attributes-of-a-table-via-python/4200/1 "2012-03-23T10:41:05Z")

</div>

i’m trying to change the columns attributes of a table (editable and treatAsBoolean) via python script using ColumnAttributesDataSet  
i need scripting it 'cause columns are added runtime and i don’t their number.  
i get this error:

```auto
TypeError: 'com.inductiveautomation.factorypmi.application.components.table.ColumnAttributesDataSet' object does not support item assignment
```

before loosing my mind finding a solution, can someone tell if ColumnAttributesDataSet is a read only dataset?

thanks

edit: this is my test code:

```auto
event.source.columnAttributesData[0, "editable"] = 1
```

---

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [March 23, 2012, 3:51pm UTC](https://forum.inductiveautomation.com/t/changing-columns-attributes-of-a-table-via-python/4200/2 "2012-03-23T15:51:57Z")

</div>

uhm, i found i have a mistake in the script:

1. accessing is to be done by the getValueAt method
2. datasets are immutable, meaning they cannot change. i have to rewrite it from scratch…

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [March 23, 2012, 4:21pm UTC](https://forum.inductiveautomation.com/t/changing-columns-attributes-of-a-table-via-python/4200/3 "2012-03-23T16:21:30Z")

</div>

Right they are immutable. But that is why we have these functions:

system.dataset.setValue  
system.dataset.addRow  
system.dataset.deleteRow  
system.dataset.updateRow

and more. Here is a link to the usermanual:

[http://www.inductiveautomation.com/support/usermanuals/ignition/system\_dataset\_setvalue.htm](http://www.inductiveautomation.com/support/usermanuals/ignition/system_dataset_setvalue.htm)

So, using the setValue function you can update the dataset. However, you can also just simply bind the Column Attributes Data property to a cell update binding where you can bind individual cells to properties or tags. Here is some more information on that:

[http://www.inductiveautomation.com/support/usermanuals/ignition/cell\_update\_binding.htm](http://www.inductiveautomation.com/support/usermanuals/ignition/cell_update_binding.htm)

---

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [March 23, 2012, 4:55pm UTC](https://forum.inductiveautomation.com/t/changing-columns-attributes-of-a-table-via-python/4200/4 "2012-03-23T16:55:39Z")

</div>

wow!  
thank you
