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 7903325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:43:13+00:00 2026-06-03T09:43:13+00:00

If I have 10 columns in a Spark datagrid, and some headers need to

  • 0

If I have 10 columns in a Spark datagrid, and some headers need to be left-justified, some headers right-justified, and some centered, what’s the simplest way to accomplish this?

Assuming a custom headerRenderer is needed, are there any simple examples that can walk me through it?

Thanks in advance for any comments.

  • 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-03T09:43:15+00:00Added an answer on June 3, 2026 at 9:43 am

    The simplest way I could find to solve this is to override the settings in the spark DefaultGridHeaderRenderer, as discussed in this link:

    http://flexponential.com/2011/10/30/changing-fontweight-of-spark-datagrid-headers/

    More specifically, I used the following custom headerRenderer, saved as file: myRightHeaderRenderer.mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <s:DefaultGridHeaderRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx" > 
    
    <fx:Declarations>
        <s:Label id="labelDisplay" 
                 verticalCenter="1" left="0" right="0" top="0" bottom="0"
                 verticalAlign="middle"
                 maxDisplayedLines="1"
                 textAlign="right"
                 fontWeight="bold"
                 showTruncationTip="true" />
    </fx:Declarations>
    
    </s:DefaultGridHeaderRenderer>
    

    This custom header renderer right-justifies header text. To use it, simply add it to one or more columns of the Spark DataGrid as follows:

    ...
    <fx:Array>
        <s:GridColumn ... />
        <s:GridColumn headerRenderer="myRightHeaderRenderer" ...>
        <s:GridColumn ... />
        ...
    </fx:Array>
    ...
    

    I’m not sure how to do it, but I’m sure it can be made more flexible by parameterizing the textAlign attribute to be center, left, or right.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spark DataGrid component with several columns and I want to have
I have a table with products that have columns like this: price[decimals 8,5] and
i have an error adding dataprovider on my spark datagrid: Multiple initializers for property
So I have columns defined like this: <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text={Binding Path=COLUMN_NAME, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}
I have a formula like this: =COUNTBLANK(BA3:BA21771)/ROWS(BA3:BA21771) I have columns that extend all the
I have a table with columns: conditional1, conditional2, data. I need to return all
I have DataGrid with Dynamic Columns. The columns will contain ItemRendrer. I'm not familiar
I have some DataGrids with pretty standard one-line itemrenderers, but need to use a
I want to disable (and look disabled) some rows in a spark datagrid. I
i have used spark datagrid for my mobile application . my problem is last

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.