8 Replies Latest reply on May 14, 2008 8:59 AM by atta707

    Datagrid select issue

    Praeter
      I am using flex builder 2.01 and have been using datagrids for a while now. I have recently ran into a weird situation where I have one datagrid out of three that just will not allow a manual selection. If I set the index to 0 for instance, the initial view of the datagrid shows the first item selected. If I go to select a different item, the first item becomes unselected and no other item can be selected. If I leave the initial state to be no item selected, I can never select an item. All other datagrids are working fine. I have tried to set selectable to true but that didn't help. This is really odd, any assistance would be greatly appreciated.
        • 1. Re: Datagrid select issue
          Praeter Level 1
          Bump
          • 2. Re: Datagrid select issue
            chris.huston.t10 Level 3
            Can you post your DeadClick function code? That is probably where the problem is coming from.

            Vygo
            • 3. Re: Datagrid select issue
              Praeter Level 1
              The code does nothing it just returns. I actually put that in there to help troubleshoot the issue. The problem exists whether I have an itemclick or not.

              public function deadclick():void{
              return;
              }
              • 4. Re: Datagrid select issue
                atta707 Level 2
                Can you show data, just 2-3 rows, in PropArchive?
                • 5. Re: Datagrid select issue
                  Praeter Level 1
                  I am not certain if you want the raw data or the data structure. So I will do my best to answer both. The data is provided from a backend server using amfphp. I return the data as an object and assign the proper portion to PropArchive:Object. The data I return is "ListingNumber, DateCreate, ListAddr1, ListAddr2, ListCity, ListState". The data returned is identical to the data used in a fully functional datagrid except this data has a archive bit set and the archive bit is not returned it is just used as part of the query. The data was actually created by the same application and the archive bit was set programaticaly via this application. I hope that answers your question.
                  • 6. Re: Datagrid select issue
                    Praeter Level 1
                    Ok... so I ran with atta707's direction to look at the data. I replaced the data source of the broken datagrid with that of the working datagrid seeing the structure is the same. To my surprise, the datagrid select worked. I am continuing to try and find the difference between the two. The get PropArchive is literally a cut and paste of the get PropData and I changed the query string from active = true to active = false. I wonder if this is one of those silly control string issues? I don't know. :(
                    • 7. Re: Datagrid select issue
                      Praeter Level 1
                      Mmmm... Well the good news is I fixed it. The bad news is I have no clue why it fixed it. This particular datagrid is in a different tab in a tabnavigator panel. Attached is the expanded working code. On the line:

                      <mx:Canvas label="Archived" width="100%" height="100%" id="ArchiveTab">

                      I had a click="{GetPropertyArchive()}" to refresh the data on tab selection. This was old code that was made unnecessary at a later date but I did not remove the code. My guess is the datagrid assumed the characteristics of the parent tabnavigator and instead of ... wait that can't be right. If that was the case then changing the datasource would not have fixed the select issue because the 'click' definition on the tabnavigator still existed. I would really like to understand why this mattered so I could avoid this issue in the future. Any ideas??
                      • 8. Re: Datagrid select issue
                        atta707 Level 2
                        > The bad news is I have no clue why it fixed it.

                        Are you sure you don't duplicate rows in your data? Are you using any custom renderers?

                        try this: add a dummy counter for each row of data with a unique value for each row and see if that fixes the problem.

                        Custom renderers, if use incorrectly, can also be reason for this problem.

                        ATTA