Title: datagrid cell style problem

I think if you’re going to want the color to follow the row around you’re going to need to use a custom cell renderer.  Have the checkbox set a property on the item and then have the cell renderer look at that property to decide what the background color should be.  If the property is null just use the default color.  Or do the alpha trick that was mentioned in a post within the last few days…

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Parekh, Shweta - BLS CTR
Sent: Wednesday, December 07, 2005 8:24 AM
To: [email protected]
Subject: [flexcoders] datagrid cell style problem

 

Hi,

I am a problem with the vertical scrolling in a datagrid.
I have a datagrid and I am trying to change the background color of a cell in the datagrid when the user checks the print checkbox. ie. the user clicks on a cell and checks the print checkbox outside the datagrid and the bg color of that cell changes. This is to fulfill the requirement that the user is given the ability to select the cells in the datagrid that can be printed as opposed to the entire datagrid.

I am not using a cell renderer for this because the user clicks on the cell and then goes outside the datagrid to the print checkbox. If he then checks this print checkbox, the background color of cell should change. I got the bg color of cell to change. But the problem is when I add more rows to the datagrid and it has a vertical scrollbar, the color messes up ie. it highlights the cells that was not clicked.moslty cells on the last row of the datagrid. I think this is because Flex re-uses cells and so every time I scroll, the previous cell that we have modified the style of is, used to display the new cell. How can I rectify this? Somebody else face problems with using style on particular cells and the style being displayed on new cells when new rows are added and datagrid is scrolled???

Below is a sample snapshot. I change the bg color of cell in row 1, add another row and scroll down and the bg color of cell in row 5 is also changed. 

Picture (Metafile)

 

Picture (Metafile)

Thanks,
Shweta




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to