4 Replies Latest reply on Dec 3, 2008 8:03 AM by Newsgroup_User

    Delete column in a datagrid

    nash99
      Hi All,
      I was trying to delete a column in the data grid .
      Explanation : The data grid has 16 columns filled with data , when a specific column is selected and the "delete button(this button is under the datagrid) is clicked I should be able to delete the column , and the subsequent columns should move to the left (for example : if I select column 7 and click delete button , column 7 should be deleted and column 8 should move left in place of the column 7).
      Can anybody please help me on this issue.

      thanks
        • 1. Re: Delete column in a datagrid
          rtalton Level 4
          click="dg.columns[0].visible=false;"
          OR
          click="c1.visible=false;"
          ...where "c1" is the id you give to the first column.
          • 2. Re: Delete column in a datagrid
            nash99 Level 1
            Hi ,
            Thanks for the reply I got a question ,
            I am providing the data provider to the Datagrid as a Arraycollection and each row (of the datagrid)is a array .
            Now when I make the column as invisible , How will I be able to delete this column (Data in the column ) from the data provider. I need to actually delete the data (data related to column) from the data provider .
            Can you please help me with this problem.

            thanks
            • 3. Delete column in a datagrid
              rtalton Level 4
              You'll need to read up on the ArrayCollection methods in the help docs (getItemAt, removeItemAt, etc.) and decide what works best for your scenario.
              • 4. Re: Delete column in a datagrid
                Level 7

                "rtalton" <webforumsuser@macromedia.com> wrote in message
                news:gh68h2$8c9$1@forums.macromedia.com...
                > You'll need to read up on the ArrayCollection methods in the help docs
                > (getItemAt, removeItemAt, etc.) and decide what works best for you
                > scenario.

                I think you'd have to loop through the array collection and remove that
                property off all the objects, assuming it's a dynamic object.