3 Replies Latest reply on Sep 20, 2008 2:01 AM by atta707

    Can a graphic object be placed in a datagrid

    SiHoop Level 1
      I have a class that draws different colored circles on the left column of a datagrid. This works as long as there are not enough entries in the grid to require scrolling-- if that happens then I'm in trouble.
      To get around this problem I'd like to place a sprite into a column of the datagrid. Each sprite could be colored differently and the problem of scrolling would not be an issue. However, I don't know whether it is possible to put a sprite into a datagrid. Can this be done? If not, is there an alternate solution?
        • 1. Re: Can a graphic object be placed in a datagrid
          Level 7

          "SiHoop" <webforumsuser@macromedia.com> wrote in message
          news:gb1q56$a00$1@forums.macromedia.com...
          >I have a class that draws different colored circles on the left column of a
          > datagrid. This works as long as there are not enough entries in the grid
          > to
          > require scrolling-- if that happens then I'm in trouble.

          Why do you say that you're in trouble if you require scrolling?


          • 2. Re: Can a graphic object be placed in a datagrid
            SiHoop Level 1
            Because the sprites are given x, y coordinates to match the number of entries in the datagrid. If the datagrid is 20 rows long, and there are 18 entries in the datagrid, then the graphics are all nicely aligned. But if there are 25 entries in the datagrid, then the graphics don't match up. Writing the code to match them up when the user scrolls seem unnecessarily hard. Adding a graphic object to the datagrid would be a nice way to resolve the issue.
            • 3. Re: Can a graphic object be placed in a datagrid
              atta707 Level 2
              What you need a custom renderer for you column. Flex Builder help has a lot of stuff on how to do this.

              Essentially, your item renderer could be based on Canvas and (probably) based on some data from the current row draws some graphics.

              ATTA