2 Replies Latest reply on Nov 5, 2008 4:59 PM by Jim Daniel

    Vertical Centering

    Jim Daniel Level 1
      Is there anyway to get the text that is displayed in the DataGrid cell to be centered vertically like you can horizontally?
      The alignText property of DataGrid does a wonderful job with Horizontally centering but I can't seem to find any property in DataGrid or DataGridColumn to do the same thing Vertically.
        • 1. Re: Vertical Centering
          thebouv
          I find it weird there is no easy way to vertically align the text in the DataGridColumn the way you want. I feel like we're overlooking something.

          However, I was able to do it with a custom ItemRenderer. Thing is, you'd have to have one for each DataGridColumn since you have to show data.YourColumnName (data.Breed for instance).

          Maybe my code can help you how to find a better way to do this. I'd like to know if you find a way to do it with a single ItemRenderer since they only differ on the data.YourColumnName bit.

          I made the item renderer make the cell 150 tall as well, so you can easily see the vertical centering.

          • 2. Re: Vertical Centering
            Jim Daniel Level 1
            I'm attempting to avoid having writing custom itemRenderers, either MXML or AS3.

            So does anyone else out there have any ideas?