# DataGrid CellRenderer AS3

**URL:** <https://forum.kirupa.com/t/datagrid-cellrenderer-as3/277790>\
**Category:** flash\
**Created:** [December 17, 2008, 10:13am UTC](https://forum.kirupa.com/t/datagrid-cellrenderer-as3/277790 "2008-12-17T10:13:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shebimangalath](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@shebimangalath](https://forum.kirupa.com/u/shebimangalath)\
**Post date:** [December 17, 2008, 10:13am UTC](https://forum.kirupa.com/t/datagrid-cellrenderer-as3/277790/1 "2008-12-17T10:13:43Z")

</div>

**here is my flash code:**

```auto
 
import fl.controls.DataGrid;
import fl.controls.dataGridClasses.DataGridColumn;
 
var html_txt = '<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="14" COLOR="#CC0000"><B><U>Template Sample2</U></B></FONT><br><br><FONT FACE="Times New Roman" SIZE="14" COLOR="#006666">The chapters in this manual are organized into the following logical groups.</FONT></P>';
 
var nameCol:DataGridColumn = new DataGridColumn("name");
var valueCol:DataGridColumn = new DataGridColumn("value");
 
var myDataGrid:DataGrid = new DataGrid();
myDataGrid.addColumn(nameCol);
myDataGrid.addColumn(valueCol);
nameCol.cellRenderer = MultiLineCell;
myDataGrid.addItem({name: html_txt, value:"Value 1"});
myDataGrid.width = 400;
myDataGrid.rowHeight = 70; //this should be auto
myDataGrid.rowCount = myDataGrid.length;
myDataGrid.move(10, 10);
myDataGrid.editable = true;
addChild(myDataGrid);

```

**here is my MultiLineCell.as:**

```auto
 
package { 
    import fl.controls.listClasses.CellRenderer; 
 
    public class MultiLineCell extends CellRenderer 
    { 
 
        public function MultiLineCell() 
        {     
            textField.wordWrap = true; 
   textField.multiline = true; 
            textField.autoSize = "left";
        } 
        override protected function drawLayout():void {             
            textField.width = this.width;
   textField.htmlText = textField.text;
            super.drawLayout(); 
        } 
    } 
}

```

**1, the DataGrid cell should be auto height according to the length of the html text, or I can use sroll bar here. and when i click on the cell, it want to show html text with out html tags.**

I think if i can use textAre here inside DataGrid it will be great!!  
help me…
