Coloring the DataGrid Background
February 8, 2007 8 Comments
Peter Ent has posted a really neat tutorial on extending the Datagrid widget to support more options of background coloring. This is one of the most elaborate and precise explanations, I have come across so far. Its not just a DataGrid component, he walks the reader through each method that has to be written so as to achieve each individual style. Especially if you are not used to Overriding protected methods, extending Classes etc., this post should really get you started.
Peter also explains various options available to color the background of a cell – with itemRenderer, without itemRenderer, setting alphas etc. It’s a must read for all! In my CustomGrid component, I am using the RowColorDataGrid component by Mike Nimer to facilitate the highlight search. Though, I have to admit, that I haven’t quiet walked through the code of the RowColorDataGrid component yet. Peter’s post rang many bells!! 🙂
The Flex DataGrid is probably the most commonly used control (after Labels and Buttons). One question that keeps popping up is, “How do I color the background of the cells?” I’ll answer that question plus show you how to color the background of columns and rows, too.