# Datagrid problem

**URL:** <https://forum.kirupa.com/t/datagrid-problem/207659>\
**Category:** Uncategorized\
**Created:** [November 20, 2006, 1:44pm UTC](https://forum.kirupa.com/t/datagrid-problem/207659 "2006-11-20T13:44:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![feilhk](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@feilhk](https://forum.kirupa.com/u/feilhk)\
**Post date:** [November 20, 2006, 1:44pm UTC](https://forum.kirupa.com/t/datagrid-problem/207659/1 "2006-11-20T13:44:54Z")

</div>

can somebody help me?  
let me explain more  
My datagrid’s data is populated from parsing xml in it by xml con and dataset  
In the Xml file i have afield ( student name)  
And in flash i create a checkbox in taketime column of the datagrid, the dataset inspector schema has student name and taketime  
 ![](http://forum.kirupa.com/uploads/kirupa/3047/63c0a4295c4c4932.jpg)  
and in the movieclip

```auto
import mx.controls.DataGrid;
// Build data provider for the data grid 
myDP = new Array();
myDP.addItem({stdChname:"",TakeTime:false});
student_dg.dataProvider = myDP;  
student_dg.getColumnAt(1).cellRenderer = "CheckBoxCell";

```

The cellrender code:

```auto
import mx.core.UIComponent;
import mx.controls.CheckBox;
class CheckBoxCell extends UIComponent {
 private var check:MovieClip;
 private var listOwner:MovieClip;
 private var getCellIndex:Function;
 function CheckBoxCell() {
 }
 private function createChildren():Void {
  check = createObject("CheckBox", "check", 1, {styleName:this, owner:this});
  check.addEventListener("click", this);
  size();
 }
 private function size():Void {
  check.setSize( __width,__ height);
  check._x = 0;
  check._y = 0;
 }
 private function setValue(str:String, item:Object, sel:Boolean):Void {
  check._visible = (item != undefined);
  check.selected = item.selected;
  check.label = item.label;
 }
 private function getPreferredHeight():Number {
  return 16;
 }
 private function click() {
  listOwner.dataProvider.editField(getCellIndex().itemIndex, "selected", check.selected);
  listOwner.dataProvider.editField(getCellIndex().itemIndex, "label", **_root.clock.time** );
 }
}

```

the bold text is what my problem, the i want to check the checkbox and that checkbox label will show the current time,  
but now , the label of the checkbox displays undefined and the checkbox isnt allowing me to tick it  
 ![](http://forum.kirupa.com/uploads/kirupa/3048/53e862d6b97f35af.jpg)
