Solved

Format specific cells or specific rows of a datagrid component.

Posted on 2008-06-25
4
517 Views
Last Modified: 2013-11-11
Seems simple, but I can't figure this out.

Is there any way in AS2 to format a specific cell of a datagrid component? So, let's say I want to make cell 2,4 bold with green text?

If this isn't possibble, or difficult, I could settle with formatting a specific row as such? For example, set row 3 to be bold with green text.
0
Comment
Question by:crickeys
  • 2
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 125 total points
ID: 21868070
Indeed it is possible using CellRenderer Class.

Using CellRenderer class, we can apply complete HTML formatting (supported by flash for any textField) to any cell of DataGrid

here is an example with source files:
http://philflash.inway.fr/htmlrdtip1/htmlrdtip1.zip

you can see the possibilities here
0
 

Author Comment

by:crickeys
ID: 21868441
That looks interesting but if I use the following code, the myHtmlFunction never gets fired?
myHtmlFunction = function (itemObj:Object, columnName:String) {
 

	trace("fired");

	

}
 

// --- DataGrid columns ---

userList_lb.columnNames = ["name"];
 

var col:mx.controls.gridclasses.DataGridColumn;

var totalWidth:Number = 0;	
 

col = userList_lb.getColumnAt(0);
 

col.headerText = "Image 1";

col.cellRenderer = "HtmlCellRenderer";

col["htmlFunction"] = myHtmlFunction;

Open in new window

0
 
LVL 34

Assisted Solution

by:Aneesh Chopra
Aneesh Chopra earned 125 total points
ID: 21871583
Have you copied "HtmlCellRenderer" into your library or not..?
0
 

Author Comment

by:crickeys
ID: 21871590
That was it, thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now