# Data Grid - addItemAt() - columns have independent indexes?

**URL:** <https://forum.kirupa.com/t/data-grid-additemat-columns-have-independent-indexes/229157>\
**Category:** flash\
**Created:** [June 14, 2007, 2:41pm UTC](https://forum.kirupa.com/t/data-grid-additemat-columns-have-independent-indexes/229157 "2007-06-14T14:41:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)\
**Post date:** [June 14, 2007, 2:41pm UTC](https://forum.kirupa.com/t/data-grid-additemat-columns-have-independent-indexes/229157/1 "2007-06-14T14:41:16Z")

</div>

Hi,

I am using a data grid component in flash AS3 and I am adding content to it with the addItemAt() method. It works but not as I would like it to.

When I add text to column 0 index 0 of the data grid, the text is placed there:

```auto

var tempData;
	if(cameraNum==0){
		tempData = { col1:""+Data;
	}else if (cameraNum==1){
		tempData = { col2:""+Data};
}

addItemAt(tempData, 0)

```

Now when I place text on column 1 index 0 of the data grid the text is placed there but the text in column 0 is pushed down to index 1.

Why is this and is there a way to insert text into columns and not have the other column index’s change position?

Thanks
