This content has been marked as final. Show 2 replies
First, this forum is for Flex version 1.5, note the title, and it is nearly abandoned. You need to post questions in the "Flex General Discussion" forum instead.
Item renderer are "recycled". that is, Flex only renderes the number needed to display, then sets the data for each of those when you scroll, or when the data otherwise changes.
So the "Selected" attribute must be set based on a value in the dataProvider item. In fact, any visual element whose state is row-based must be ste based on the data.
See this blog for more info:
When we add a customized checkbox column to a datagrid in .net (windows application) , the default property allows to check or uncheck the column using a double click. On the first click it selects the column and on the second click the column is either checked or unchecked.To change this default property, we need to handle the click event on grid and modify the selected cell value. Here is the sample code to achieve this.[C#.NET VS 2003 , Code to add checkbox column to grid using table style property]dgItemDetails.TableStyles.Clear(); // clears the tablestyle (dgItemDetails is the name of grid)
DataGridTableStyle dgt = new DataGridTableStyle();
dgt.MappingName = "ItemDetails";
DataGridBoolColumn dgbCol = new DataGridBoolColumn(); // creates the checkbox column
dgbCol.MappingName = "Select";
dgbCol.HeaderText = "";
dgbCol.Width = 40;
dgbCol.AllowNull = false;
dgbCol.Alignment = HorizontalAlignment.Left;
dgt.GridColumnStyles.Add(dgbCol);dgItemDetails.TableStyles.Add(dgt); // add