Format specific cells or specific rows of a datagrid component.

Posted on 2008-06-25
Medium Priority
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.
Question by:crickeys
  • 2
  • 2
LVL 34

Accepted Solution

Aneesh Chopra earned 375 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:

you can see the possibilities here

Author Comment

ID: 21868441
That looks interesting but if I use the following code, the myHtmlFunction never gets fired?
myHtmlFunction = function (itemObj:Object, columnName:String) {
// --- 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

LVL 34

Assisted Solution

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

Author Comment

ID: 21871590
That was it, thanks.

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this Micro Tutorial viewers will learn the basic shortcuts and functions of Illustrator. The viewer will learn about the paintbrush tool, anchor points, font sizing, and more.
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

624 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