2 Replies Latest reply on Feb 5, 2007 5:50 PM by doug777

    Problem with DataGridEvent

      After using a DataGridEvent with an editable GridItem in a DataGrid, the selectedIndex cannot be changed from -1 by user interaction. The highlight moves, but the selectedIndex remains at -1 or whatever it has been set to in the program.

      Anyone know how to get around this problem?

        • 1. Re: Problem with DataGridEvent
          _Albertx_ Level 1
          Hmm... Did you make a binding to a variable with the selectedIndex property of the DataGrid??? or how do you get the selectedIndex ?? with an event? or an action or a button? or how ?
          • 2. Re: Problem with DataGridEvent
            doug777 Level 1
            Many thanks for your reply.

            You're right the problem was linked to the binding. I was using the Bindable metatag, but after I got rid of this and set up my own change listener, this problem disappeared.

            I then had the problem that at least the item_edit_end and the item_focus_out events fire twice after you trigger the event once, and depending on the code this can cause problems; at one time something I had caused the event to trigger endlessly crashing the computer when the memory ran out.

            Setting a counter to 0 and then in the handler: counter++ and only running any code after the event when counter%2 is true, solves all the problems and everything now works correctly.

            I am nervous though that there could be a bug somewhere in the Flex code which if it eventually gets fixed will make my code fail sometime in the future.