Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7933041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:12:20+00:00 2026-06-03T21:12:20+00:00

Maybe this is really simple, but I can’t figure out how to set ‘textAlign’

  • 0

Maybe this is really simple, but I can’t figure out how to set ‘textAlign’ property for default itemRenderer in AS3 (not mxml). I need to adjust it based on type’s properties, ‘int’ or ‘Number’ aligned right, ‘String’ aligned left and so on.

I’m using spark DataGrid and listening FlexEvent.CREATION_COMPLETE event; I can’t cast itemRenderer to DefaultGridItemRenderer, and ClassFactory doesn’t provide setStyle method.

public function adjustGrid (e:Event):void
{
    for (var i:int=0; i<grd.columns.length; i++)
    {
        var gridColumn:GridColumn = GridColumn(grd.columns.getItemAt(i));
        DefaultGridItemRenderer(gridColumn.itemRenderer).setStyle("textAlign", "right");
    //ClassFactory(gridColumn.itemRenderer).setStyle("textAlign", "right");
    }
}

Any help I will appreciate.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:12:22+00:00Added an answer on June 3, 2026 at 9:12 pm

    extends DefaultGridItemRenderer…….

    override public function getTextStyles():TextFormat{
      var tf:TextFormat = super.getTextStyles();
      tf.align = "right";
      return tf;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe it's easy, but I couldn't really figure this out right so far... I
There maybe some simlar questions to this but I can't see anything that really
This maybe a really simple question but for some reason my code isn't working.
This is maybe a really simple question, but I couldn't locate an answer: For
OK, this may be really simple, but it is Friday and it has been
Maybe this isn't really feasible. But basically, I've been developing a snippet-sharing website and
maybe I'm just failing in a really simple thing but I'm developing an intepreter
My problem seems to be really simple but I just can't get the reason
Maybe a simple question but I really don't know what to do. When I
Maybe there is a really simple solution for my problem, but I'm really confused

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.