Colors of the datgrid cell change on scrolling

Hi,
This issue is regarding datagrid. I am working on a functionality which involves the coloring of datagrid cell. When the user clicks a cell, a dropdown appears having the color names. This dropdown is a separate component which has been set as the item editor of the datagrid column. After selecting the color form the dropdown, the color gets applied to the clicked cell through a custom item renderer applied to the column. A method in the custom item renderer has the code for drawing a graphic with the color selected by the user. Now the issue is that whenever, we scroll, the colors in the datagrid cells get shifted downwards. This also happens if I move to the other tabs and come back to this tab having the datagrid.
If the color of the first and second cell in a column is changed, when I scroll horizontally, the colors in the first and second cell get shifted to the third and fourth cell and so on...This also happens when we switch across the tabs...
What I understand is that on scrolling the updateDisplayList gets called. That is why the color changes...But how to retain the colors selected by the user.
Thanks in advance.
Regards,
Shally

Hi,
Pls check your the item renderer. You must need to mentioned code as below inside your item Renderer.Then it should work fine.
override public function set data(value:Object):void
super.data = value;
For more details you can check this thread.Although it is for the List but you can do similarly for the datagrid.
http://forums.adobe.com/message/2118862#2118862
with Regards,
Shardul Singh Bartwal

Similar Messages

  • When I visit a site the color of the link seldom changes to the color I have selected. also even when it does change, it reverts to the unvisited color in a day or so.

    When I visit a site the color of the link seldom changes to the color I have selected. Also even when it does change, it reverts to the unvisited color in a day or so. The history is set to over 300 days and everything is there as far as I can tell.

    Does this problem affect all sites, or only some? Try going to a Google search results page and click a few links. Then, come back a day later and see if they are still visited.
    It may be that the links that get reset are coming from a frameset. Firefox only remembers history from framesets temporarily, which affects sites that use them. (An example would be the craigslist forums)

  • How to remove the orange default color of the first cell in an ALV report

    Hello all,
    I have coded an ALV grid report (in ABAP object) and when I execute it, I saw that the first cell containing data, in the top left corner of the ALV grid is always colored in orange by default. This bothers me because I have colored this cell in green (if I select an other line in my grid, I can clearly see that my top left cell is colored in green).
    Does anyone knows how to "desactivate" this orange default color ?
    Thanks for your answer.
    Best regards
    Cyril S.

    Thanks Uwe and Rainer,
    Unfortunately, I tried what you mentioned both and nothing works.
    As you said, it seems mandatory that a cell must be selected by default in an ALV grid.
    That's a pity because this "ugly orange" hides my beautiful green color.
    I will answer my customer that it is not possible. That's all.
    Thank you for your help. I did appreciate.
    Best regards
    Cyril S.

  • Edit JTable Date Cell, press Enter, the Time Cell changes to GMT time!

    Has anyone seen this strange behavior? I try to edit a Date Cell in JTable (orig. value 10/02/2000) and change it to (10/03/2000), I press Enter. But, the value of my Time Cell in the next column, same row which I never edited (orig. value 00:05:00) changes to approximately my system time in GMT (16:28:48).
    This is an excerpt from my TableModel which get called from setValueAt():1734 javax.swing.JTable, JTable.java. In the code below, the debug statement prints out:
    row, col = 0,0
    Value in SubTableModel = 10-02-2000 16:28:48
    Value should be "10-02-2000" since I did not edit the time cell at all. And why is row and col both zero?
    public void setValueAt(Object value, int row, int col) {
    try {
    ((ITableCellAdapter)adapters.get(col)).setData(getRow(row),col);
    System.out.println("row, col = " + row + col);
    System.out.println("Value in SubTableModel = " + value.toString());
    ((ITableCellAdapter)adapters.get(col)).setValue(value);
    catch (PropertyVetoException badSet) {
    System.out.println("could not set value");
    fireTableCellUpdated(row,col);
    How can I force it to set the date cell's new value only and leave the time cell alone?
    I've also seen that sometimes my date entry gets lost, the old value still showing, what am I doing wrong? I've seen a bunch of bug parade listings about terminating edits within a JTable being buggy, is this related?
    Any help on this is most appreciated!

    Did you find the solution to yuor problem?
    Has anyone seen this strange behavior? I try to edit
    a Date Cell in JTable (orig. value 10/02/2000) and
    change it to (10/03/2000), I press Enter. But, the
    value of my Time Cell in the next column, same row
    which I never edited (orig. value 00:05:00) changes to
    approximately my system time in GMT (16:28:48).
    This is an excerpt from my TableModel which get called
    from setValueAt():1734 javax.swing.JTable,
    JTable.java. In the code below, the debug statement
    prints out:
    row, col = 0,0
    Value in SubTableModel = 10-02-2000 16:28:48
    Value should be "10-02-2000" since I did not edit the
    time cell at all. And why is row and col both zero?
    public void setValueAt(Object value, int row, int
    nt col) {
    try {
    ((ITableCellAdapter)adapters.get(col)).setData(getRow(
    ow),col);
    System.out.println("row, col = " + row +
    + row + col);
    System.out.println("Value in SubTableModel = "
    del = " + value.toString());
    ((ITableCellAdapter)adapters.get(col)).setValue(value)
    catch (PropertyVetoException badSet) {
    System.out.println("could not set value");
    fireTableCellUpdated(row,col);
    How can I force it to set the date cell's new value
    only and leave the time cell alone?
    I've also seen that sometimes my date entry gets lost,
    the old value still showing, what am I doing wrong?
    I've seen a bunch of bug parade listings about
    terminating edits within a JTable being buggy, is
    this related?
    Any help on this is most appreciated!

  • Color behind the tabbs of JTabbedPane in SCROLL layout

    Hi all, This is a repost as no one gave me a solution for this problem.
    When SCROLL_TAB_LAYOUT is specified, the color behind the tabbs is not the color of its container. With WRAP layout, the color behind the tabbs is the color of its container.
    Is this a bug? or am I doing wrong?
    If one can execute this code, it would be clear of what I am talking about. Just comment out the tabbPane.setTabLayoutPolicy line and run it again to see the actual behaviour.
    JTabbedPane tabbPane = new JTabbedPane();
    tabbPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    tabbPane.setBackground(Color.white);
    tabbPane.add("one",new JPanel());
    tabbPane.add("two",new JPanel());
    JPanel parentPanel = new JPanel(new BorderLayout());
    parentPanel.setBackground(Color.red); // the color i want to be appeared as the background for tabbed pane and not for tabbs.
    parentPanel.add(tabbPane,BorderLayout.CENTER);
    JFrame jf = new JFrame();
    jf.getContentPane().add(parentPanel);
    jf.pack();
    jf.setVisible(true);
    Thanks in advance.

    Maybe this:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4690946
    Bug ID:      4690946
    Votes      6
    Synopsis      REGRESSION: JTabbedPane.setBackground() and setOpaque() have no effect
    Category      java:classes_swing
    Reported Against      1.4
    Release Fixed      1.5(tiger)
    State      Closed, fixed

  • Can I change the fill color of an entire row based on what's selected in a pop-up menu in the first cell?

    I have a pop-up menu in the first cell of every row with three choices (and I may add more at a later date).  I want the fill color of the row to change depending on which thing is selected.  Is this hard to do?

    Hi,
    In essence the same as Wayne's answer, but with a slight modification to fit  to duplicate your 'color the whole row' specification. The final result, with Table 2 slid behind Table 1, is shown.
    Table 2 is a single column table with the same number of rows as Table 1. The table is resized to match the full width of Table 1.
    In A2, use the formula =Table 1::A2 to copy the value from that cell in Table 2. Fill the formula down through the rest of the column.
    Select all the cells in Table 2 (except the header row), and apply conditional formatting rules such as those below.
    Note that the Conditional Format rules are set to apply the same colour to text and fill in the cell, so that the text disappears.
    When Table 2 is ready, select it, then go Arrange > Send to Back.
    Before sliding Table 2 behind Table 1, Select Table 1 and use the Table Inspector to set the Cell Background to None (see red arrow in illustration). If This table has a Header column, you need to select the header cells independently and again set the Cell Background to None.
    Now select Table 2 and drag it to a position partially under Table 1. When you see the blue alignment guides on both sides, or at the top and bottom, of Table 1, release the mouse button and use the arrow keys to nudge Table 2 into its final position.
    Regards,
    Barry

  • Jasper Export to excel: changing background color of the cell/field

    Hi all,
    I have designed a report containing a set of 5 different fields. All these are STRING values.
    Among these are two fields named: BUDGETED and ACTUAL.
    I want to show the data corresponding to ACTUAL in red color if the value of ACTUAL is greater than BUDGETED when exported in excel format.
    The value itself should be displayed in red color or the excel cell should have a color red
    Can someone please help me in this? How can we implement the logic to compare these two values?
    Thanks in advance.

    You are using Jasper and you thought: hey, let me post a question in the Oracle Reports forum?

  • Just updated to new Firefox - now when clicking on a website to visit the color of the print no longer changes to indicate that I have visited that site already. How can I get that feature again?

    Since updating to new firefox I have lost a very helpful tool. Before, when I clicked on a website to visit, the color of the print would change from blue to purple to indicate that I had visited that site. Now it does not do that so it is difficult to keep track of what sites I have visited and what sites I haven't when looking down the list of possible sites to visit.

    Make sure that you do not run Firefox in permanent Private Browsing mode.
    *https://support.mozilla.com/kb/Private+Browsing
    *You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
    *To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Deselect: [ ] "Permanent Private Browsing mode"
    Make sure that the History is enabled:
    * Tools > Options > Privacy > Firefox will: "Use custom settings for history" > Remember my browsing history
    See also http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/

  • Is it possible to change the color of the text in one specific field?

    If I want to make someone's mobile number show up as the primary contact, is it possible to make the text for that number a different color or make it bold? I can't seem to find a way to do it.
    Thanks.

    Make a Shape > Inspector > Graphic > Tinted Image Fill > Scale to fit > browse to image > click on the color patch to change the color to what you want
    or
    Drag in an image > overlay it with a Shape > select the color for the shape and change its Opacity
    Shapes may have Gradient and Advanced Gradient (multiple colors) fills both linear and radial. Both are in the Graphic Inspector as is Opacity.
    Peter

  • Can you change the color of the page?

    Can you change the color of the page using In Design CS5.5 ?
    How?

    Are you intending to print a color onto the page to change the color or perhaps you need a colored background for onscreen output? Or are you planning on printing on already-colored stock?
    For the former, use Scott's suggestion, for the latter edit the Paper swatch.

  • Jtable keep the selected cells' background

    hi,
    I want to change the background color of the selected cells.
    after selection, I may do another selection,but I want to keep the previous selected cells' background color.
    any help will be appreciated!
    thanks!
    zhangv

    Did you try using Ctrl + Mouse Click ?
    Remember you need to set following property before you try the above solution:
    tableObj.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • In Dreamweaver 6, I created a new fluid layout. I set up (4) DIVs. In the 3rd div, I changed the font color. The new color shows up on the website when viewed in my computer desktop, but, when viewed in a tablet and a cell phone, the color of the font doe

    In Dreamweaver 6, I created a new fluid layout. I set up (4) DIVs. In the 3rd div, I changed the font color. The new color shows up on the website when viewed in my computer desktop, but, when viewed in a tablet and a cell phone, the color of the font does not change. It's the same in Dreamweaver's Live view. It shows the new color on Desktop view and not in the cell phone or tablet view. Also, I changed the font itself in one of the DIVs and it shows up in the new font on the desktop view and website viewed thru the computer, but, not on the tablet or cell phone. Can someone please explain. I want to be able to change the fonts and colors for viewing in the tablet and cell phone, also. The fonts were all standard fonts. Sans-erif and Verdana and Arial were tried. Thanks.

    I will lock this discussion because of duplicate post.

  • Get the active cell in a table on a mouse click, so I can change its color

    Hi guys,
    I am looking at a small application.
    I  have a table. When a user clicks on a particular cell, I need the cell coordinates so that I can change its attributes (e.g. color change) by clicking a button.
    Edit position property of the table gives me the current cell coordinates, but when I click on a button, the previously clicked cell position is lost. How can I fix this problem?
    Is there a way to solve this problem?
    Thanks
    Ravi
    Solved!
    Go to Solution.

    rpula wrote:
    Thanks for the reply. But, Iam trying to avoid using event structures for someother reason in my code. Is there a way, this could be done without event structures.
    Please look at the code attached. Whenever the value in the table goes beyond 100, i want to click on the corresponding cell and then suspend it by using the suspend button, in which case the backgroud color should change to red.
    Thanks
    Saverio's suggestion to use an event structure is a good one so rather than exploring less efficient methods, could you please explain why you are avoiding teh use of an event structure? This will help us help you.
    Just trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Trying to change the color of a single cell

    hi, I am trying to change the color of a single cell when mouse moves over it, but couldn't do it. i even tried my own renderer, but it doesn't work. can anybody help ?

    Here is what I am trying to do. I am displaying some data in a java JTable retrieved from a table in database. What is needed is when user moves his mouse over any cell in the third column, the cursor should change to hand cursor and possibly the background color should also change, to indicate the user that this cell is clickable. I have to show some other report when user clicks any cell in column three. The code follows as
    import java.awt.*;
    import java.sql.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.sql.rowset.*;
    import javax.swing.table.*;
    public class MouseMotionInTable extends JFrame
    public static void main(String[] args)
      MouseMotionInTable f = new MouseMotionInTable();
      Toolkit tk = Toolkit.getDefaultToolkit();
      Dimension dim = tk.getScreenSize();
      int w = dim.width;
      int h = dim.height;
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      f.setBounds((w-600)/2, (h-300)/2, 600, 300);
      f.setVisible(true);
    MouseMotionInTable()
      Connection con = null;
      CachedRowSet crs = null;
      try
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       con = DriverManager.getConnection("jdbc:odbc:FMS", "", "");
       Statement st = con.createStatement();
       String query = "SELECT ItemName, Alias, ItemReOrderQuty, ItemMeasure FROM ItemInfo";
       ResultSet rs = st.executeQuery(query);
       crs = new com.sun.rowset.CachedRowSetImpl();
       crs.populate(rs);
       st.close();
      catch (SQLException e)
       e.printStackTrace();
      catch (ClassNotFoundException e)
       e.printStackTrace();
      finally
       if(con != null)
        try
         con.close();
        catch (SQLException e)
         e.printStackTrace();
      DBTableModel model = new DBTableModel(crs);
      table = new JTable(model);
      JPanel center = new JPanel();
      center.setLayout(new BorderLayout());
      center.add(new JScrollPane(table), BorderLayout.CENTER);
      add(center, BorderLayout.CENTER);
      table.addMouseMotionListener(new MouseMotionAdapter()
       public void mouseMoved(MouseEvent me)
        int col = table.columnAtPoint(new Point(me.getX(), me.getY()));
        int row = table.rowAtPoint(new Point(me.getX(), me.getY()));
        if(col == 2)
         Object val = table.getValueAt(row, col);
         boolean isSelect = table.isCellSelected(row, col);
         boolean focus = table.isCellSelected(row, col);
         TableCellRenderer cellRender = table.getCellRenderer(row, col);
         Component comp = cellRender.getTableCellRendererComponent(table, val, isSelect, focus, row, col);
         comp.setCursor(new Cursor(Cursor.HAND_CURSOR));
         comp.setBackground(Color.yellow);
    private JTable table;
    class DBTableModel extends AbstractTableModel
    ResultSet rs;
    ResultSetMetaData rsMeta;
    DBTableModel(ResultSet rs)
      try
       this.rs = rs;
       rsMeta = rs.getMetaData();
      catch(SQLException e)
       e.printStackTrace();
    public int getColumnCount()
      try
       return rsMeta.getColumnCount();  
      catch(SQLException e)
       e.printStackTrace();
      return -1;
    public String getColumnName(int c)
      try
       return rsMeta.getColumnName(c+1);
      catch(SQLException e)
       e.printStackTrace();
      return "";
    public int getRowCount()
      try
       rs.last();
       return rs.getRow();
      catch(SQLException e)
       e.printStackTrace();
      return -1;
    public Object getValueAt(int r, int c)
      try
       rs.absolute(r+1);
       return rs.getObject(c+1);
      catch(SQLException e)
       e.printStackTrace();
      return "";
    public boolean isCellEditable(int r, int c)
      return false;
    public Class getColumnClass(int c)
      return getValueAt(0,c).getClass();
    }

Maybe you are looking for

  • Extension2 to be used in BAPI_OUTB_DELIVERY_CHANGE

    Hi, I am using the bAPI BAPI_OUTB_DELIVERY_CHANGE to update two zfields in table LIPS but am unable to update the same using the extension table. I have searched for this post but did not get a satisfying answer for the same. I found that the BADI SM

  • LiveFonts not working properly

    Hi, my livefonts is not working properly. When i apply to the words, some alphabets doesn't show up. Anyone got suggestions how to rectify the problem?

  • Xorg Intel problems

    Interestingly enough I managed to solve this fairly quickly, but figured I would post in case someone else had a similar issue. I recently ran an upgrade and Xorg stopped working.  The whole No Screen issue.  When I looked at my xorg.conf it showed V

  • V$sql, v$sqlarea and v$sqltext

    Hello, Any idea how to isolate PLSQL objects calls from SQL statement in following views? v$sql, v$sqlarea, v$sqltext For e.g. I ran following query but it would also include SELECT statements. Whereas I only need PLSQL Calls. select * from v$sql whe

  • Frames N/a for photo border in PSE plus

    Hello, I have installed, uninstalled and re-installed once again PSE plus, . It does  not give me access to the frame option under content.  Although I have also downloaded the software on my macbook pro, that option is available . Why would I have a