Which example did you start with?  Which event do you use to deselect the other 
rows, and what does that code look like?

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Glenn Jones
Sent: Thursday, January 08, 2009 9:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DataGrid selectAll problem


Hi,

I'm using Flex 3.2 and I have a DataGrid which implements a column of 
checkboxes to select rows.  I started with Alex' example.
Then I added a header renderer on the checkbox column such that if check the 
header, then all rows are selected.
To implement the select all behavior, I'm creating an array of indices for 
[0..n] and assigning that array to mx:DataGrid.selectedIndices.

For the most part this works fine.

But if the DataGrid is editable, then I sometimes have a problem. The problem 
is that if all rows are selected, and you click on
an editable cell, sometimes the cell becomes editable without deselecting all 
of the other rows. The behavior I want is that
if you start editing a cell, then just that row becomes selected. This happens 
some of time, but not all of the time.

If the grid is non-editable, then I can't reproduce the problem.

I overrode mx:DataGrid.selectItem() in order to clear the checkbox in the 
header renderer any time a single item is selected.  I've
noticed that when the problem behavior occurs, the mx:DataGrid.selectItem() 
method is never called.

It's almost like there's some race condition between selecting an item and 
starting a cell edit.

Any ideas on how I could work around this?

Thanks,
Glenn

Reply via email to