Changing the color of text in the DataGrid cell conditionally

I am using a DataGrid in my application and my requirement is
to change format and style of data value in the DataGridColumn per
below:
If the data value is a negative number
1. change the color of a value to red
2. remove the '-'ive sign
3. include the value between in parenthesis.
I was able to accomplish 2 & 3 in the labelFunction for
the DataGridColumn. But have been struggling to accomplish (1)
within the label function.
Can this be done in the labelFunction? I am using Flex 2.0.1.
Appreciate any help with this.
Thanks.

you'd probably best use an item renderer to change the color.
have a look at
background
color in item renderers on
alex's flex closet for an
example of this.

Similar Messages

  • May I know how to change the color of texts inside the indicator box?

    Can anyone tell me how to change the color of texts inside the indicator box? I have tried to use property node but not really know how it functions.
    In fact, I am writing a program for which the number inside indicator on front panel will show red color if the measured value can't reach the requirement. I am using LabView 6.1 Professional
    Thank You for your attention!!!!!!

    Simply use a property node with "NumText.TextColor" and wire the correct color depending on your test result.
    The attached simple example (LV 6.1) lets you change it from the front panel. In your case, you would use your test output instead of a FP switch, of course. Message Edited by altenbach on 05-25-2005 09:05 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    TextColor.vi ‏18 KB

  • Tabular Forms - how to change the color of text when the field is disabled

    Hi,
    I have a tabular form and some of it's columns are disabled showing text in grey color...
    is there a way to change the color to black and bold the text...?
    thanks

    Okay, i've taken a look at your example.
    The column formatting does not work on the input fields. The help on the item says that it generates a span with a style attribute. This would work for a display field, not for an input field.
    Css like i've written should be in the style tags, put up in the header section of the page (page -> edit -> header region).
    You've already put script tags there, the style tags go there aswell. You shouldn't even need to put your script tags in the header region. Just put your code up in the javascript functions region (without the script tags).
    However, i tested in firefox and here color works on an input field, changing the font color. In IE it does not do this. Cross browser implementations and such, not much to do about it here. See http://stackoverflow.com/questions/602070/changing-font-colour-in-textboxes-in-ie-which-are-disabled.
    I did notice that you build your form with a bunch of input fields, which you disable through javascript in the footer of the region. Then on submit, you set the disabled to false again for all those fields! If you want those fields to always be submitted to the server, why wouldn't you use the readonly attribute? Readonly fields are always submitted, and can't be edited by the user. Plus, readonly fields CAN be styled however you want! You can get rid of the javascript code in your header then.
    Even the javascript in the footer is not necessary. If you just add 'readonly="true"' (without single quotes) to the element attributes of your items (edit column -> column attributes region) = no javascript at all (less maintenance).

  • Change the color of text in the title bar

    Hi,
    I have a JFrame. I want to be able to change the color of the text in the title bar. Do any of you know how to do this ?
    Please let me know.
    Thanks
    Sangeetha

    If you are using Windows, you do it through the Control Panel tool for customizing your desktop display. If you are using some other system, I don't know. You can't do it from your Java program.

  • I am unable to change the color of text in an email I replay to or compose. I am on 31.6.0 release of Thunderbird.

    When I receive, reply or compose email. I no longer am able to see or change the color of text. I select to change the text from black to Red (or any other color) and the text just stays black, The color seletor box will show the last select color, but never actually changes the text color in an email. Also in received email, when the sender has indicated their replies to me are in another color, All the text only appears as black. I never had this problem in the past, not sure what has happened. I did restart Thunderbird with add-ons disabled and this did not change the problem.

    Hello, maybe the question need to move by a moderator to thunderbird support ?
    https://support.mozilla.org/en-US/questions/thunderbird?owner=all
    thank you
    [moderator note: question thread has been moved from Firefox queue to Thunderbird queue]

  • Is there a way to change the font size and color of text in the calendar app?

    Does anyone know a way of changing the font size and color of text in the calendar app that comes with the iPad 2?  It is very hard to see the small gray numbers on the calendar.  Thanks

    Looks like you didn't get a reply on your post, but it is still a problem.  Font size is supposedly changeable via "Accessibility" in Settings, but it doesn't work.  You can turn on "Zoom".

  • How do I change the color of text in Messages?

    How do I change the color of text in Messages? It was easy to do before, but I can't seem to find it after the upgrade.. is it a hidden menu option?  The gray text is really annoying.

    Two possible ways are available
    Set the text with and html text string like "<html><font color-red>" + text + "</font></html>"
    or get the cellrenderer, cast to the DefaultCellRenderer and call setForeground or background or implement or your own cellrenderer to do the custom coloring (this could maybe depend on indexes)
    ICE

  • How do you change the color of text messages?

    Can you change the color of text messages?  If so, how?

    Two colors. Blue and green.
    Green is for text message. Blue is for iMessage. You can't change these, though.

  • Change the color of text item after execute query

    Dear friends
    I would like to know how can I make a tabular form like grid and chang the color of text item when (for exp in emp table) the value of sal column between 2000$ and 4000$.
    I used the SE_IEM_PROPERTY command but it change all of the text items of sal column.
    please help me
    thanks a lot

    Highlight the Existing Record in Forms
    (Compatible with 4.x, 5.x, 6.x & 9i)
    Step 1: Create a New Visual Attribute(BLUE_VA) (Color of highlighted record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
              Foreground Color – Black
              Background Color – Blue
              Fill Pattern – Transparent
    Step 2: Create another Visual Attribute (WHITE_VA) (Default Color of the record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
    Foreground Color – Black
              Background Color – White
              Fill Pattern – Transparent
    Step 3: Add Following code to Block-level Trigger WHEN-NEW-RECORD- INSTANCE, POST-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'BLUE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'BLUE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    Step 4: Add Following code to Block-level Trigger PRE-RECORD, PRE-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'WHITE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'WHITE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    I am using the above code in one of my forms and I so far haven't seen any problem

  • Can I change the reort total: text in the summary row in a report region?

    Hi all,
    This might has been asked before, I tried searching the forum but couldn't find an answer. In the report attribute, if I tick the sum checkbox then run the page, the last row would give me the summary numbers which is what I want. However is there a way I can change the "report total" text in the last row of the first column?
    Thanks very much for your time.
    Pete

    Hello user9546327,
    I had the same problem, until I realised that the text seems to be printed under the first column of the report. If that one is a hidden column, the text won't be printed in the report.
    Solution:
    In the 'Report Attributes' tab, move the first visible column (= attribute 'Show' is ticked) to the top of the report columns.
    Best regards,
    Sabine

  • Can I change the color of folders in the mail application?

    Can I change the color of folders in the mail application?

    Not that I know if. Post over in the Mail forum area of the Snow Leopard forum.

  • The old calender iOS6, in the year view, it shows how much busy I am in a day by indicating the color intensity. But the new calendar year view is totally useless!!! also too bright!! Why apple does this?? What is the way to revert the calendar back???

    The old calender iOS6, in the year view, it shows how much busy I am in a day by indicating the color intensity. But the new calendar year view is totally useless!!! also too bright!! Why apple does this?? What is the way to revert the calendar back???

    Unfortunately, that's the way the cookie crumbles nowadays. Sir Jony Ive's GUI design for iOS7 has been met with much skepticism (to say the least). But until the company sees the compelling need for an adjustment or reversal, it "ain't happenin' ". So amble over to the feedback page ( http://www.apple.com/feedback/ ) and make your displeasure known to the company, OR make it known by not purchasing its products. Because as long as the iGadgets continue selling as fast as they can make them, they will see no need for change.
    BTW, do note you are NOT talking to Apple here. This is just a user-to-user forum.
    Edit: for now, you can also try out any of the alternate calendaring apps available in the App Store.

  • How can I create a scatter brush that preserves the color and opacity of the original selection?

    I'd like to scatter a small image randomly, like you can with scatter & size jitter. I can't think of any way to do that on this image other than make a brush out of it, but creating a brush from the image will change its color uniformly. I'd like to keep the color and opacity of the image the same, but have it scattered. I'm sure there's a way to do this, but I can't figure out how. Any ideas?

    I found a free plugin that should do, but we just need to know what operating system your using?
    I think the plugin is windows only.
    It's called mmCopies
    MuRa Filter Meister - Photoshop Plugins
    http://www.ahadesign.eu/download/allgemein.html
    http://www.ahadesign.eu/bildbearbeitung/tutorials/bildbearbeitung/381-mura-filter-meister- und-windows-vista-problem.html
    works on windows 7 x64 in cs3:

  • Append hyphen automatically after the wrapping of text in the dimension field

    Post Author: Nita_here
    CA Forum: WebIntelligence Reporting
    I want to Append hyphen automatically after the wrapping of text in the dimension field.
    e.g the text reads "I want to wrap this text". then if cell width exceeds after "I want to wrap" then it should be displayed like this "I want to wrap-" "this text".
    Thanks in advance,
    Nita

    Post Author: Nita_here
    CA Forum: WebIntelligence Reporting
    Thanks for your input.
    Let me tell you what I have understood. I will create a variable having the formula (which i have earlier written) in universe. Whenever i need to use the formula in infoview, I will call the variable instead. That's fine. But again, I will have the same problem. If I do any change in infoview level, the cell width is bound to change as it is not the free standing cell, its a column among othe one. e.g.
    A  B  C
    1  2  3
    4  5  6
    (you can think B as the column). Any change(addition, deletion of columns) will certainly change the cell width of B. So, again I need to calculate the things, which i dont want.
    Nita_here: I manually calculated that after 12 characters, the cell wraps the text.
    I wonder if there would be a way to do the things dynamically.
    Thanks in advance,
    Nita

  • How can I separate the "Icons and Text" of the browser control buttons (Back, Forward, etc.) from the Icons on the Add-on toolbar?

    At home, this is not an issue. I don't know why it's different here at work--same installation, same settings (as far as I can tell).
    Windows Vista
    Firefox 7.0.1
    Status-4-Evar installed to turn add-on bar into a status bar
    I have a NoScript add-on icon in the corner, which works fine. If I add a GreaseMonkey icon from the Customize menu, the "Icon and Text" appears for that icon, like the Icon and Text from the browser controls (Home, stop, etc). Other add-on icons also show Icon and Text (S4E, for instance). NoScript is the only one I've found so far which collapses down to just an Icon.
    This leads to the status (add-on) bar having a much larger height than I like. Essentially what I want is for only the Icon to appear in the Status bar (Add-on toolbar), while keeping Icons and Text in the Browser controls. My current workaround is simply removing the other add-on icons from the status (add-on) toolbar, but that takes away the ease of toggling and setting options.
    Please tell me if I can provide you with anything else, and thanks for your help.
    Edit: I've got some screenshots to show what I mean.
    [http://i41.tinypic.com/ftek9s.jpg desired behavior]
    [http://i43.tinypic.com/1z6a4h3.jpg problem when icon is added]

    Surely there must be some UserChrome.css that will solve this problem. Something like this:
    /* Remove text titles for icons in add-on bar */
    addonbar .button-text {
    visibility: collapse !important;
    Unfortunately that does not work. I probably have the button text item name wrong (there is a pound sign before addonbar but it doesn't show in this posting).

Maybe you are looking for