Re: changing Selected row color flex2 datagrid

Hai,

I'm flex1.5 migration to Flex 2, I need to change the colur of selected row in datagrid I used dg.setpropertiesAt (dg, selectedIndex, "backgroundColor:0xFF000")

method in flex 1.5 What is the alternative method to change the color of line

Emissions of the grid of Flex1.5

Picture0002.png

Thanks in advance

You use styles;

dg.setStyle ('selectionColor', 0xcccccc);

You can do this in code or by using a style sheet.

Andrew

Tags: Flex

Similar Questions

  • ObjectListField change selected line color

    The default selected line is blue, is it possible to change this?  I tried

    graphics.setBackgroundColor (Color.LIGHTGREY);

    Which changes not the background, but I don't see how to change the color of the selected line.

    This is the skeleton of the class we use trying to hightlight the target ourselves line:

    private class XXXXListField extends {ListField
    Special list field designed to ensure that the field gets updated when the focus moves
    This is necessary because we try to display lines of development of the background colors.
    Private boolean _inFocus = false;
    public XXXXListField() {}
    Super();
    }

    public int moveFocus (amount int, int status, time int) {}
    This.Invalidate (getSelectedIndex ());
    Return super.moveFocus (amount, status, time);
    }

    Called when the field receives focus.
    {} public void onFocus (int direction)
    hasFocus = true;
    _inFocus = true;
    super.onFocus (branch);
    }

    Called when a field loses focus.
    public void onUnfocus() {}
    hasFocus = false;
    _inFocus = false;
    super.onUnfocus ();
    This.Invalidate (getSelectedIndex ());
    }

    public boolean isFocus() {}
    Return _inFocus;
    }

    }

  • ADF Table how to change the color Selected row in the array unfocuse.

    Hi all

    I have a requirment where I select the row of the table ADF and unfocuse on the table.

    According to the framework it gives me the light yellow color.

    How can I change this color with another color.

    Pls suggest.

    Thanks to Advans

    Barry Mucheli.

    Hello, Barry Mucheli.

    To change the color of the selected row when it loses focus, add the following code in your skin css file.

    AF | : the table-row data: selected: inactive af | : the column cell data

    {

    background-color: Green;

    }

    RFH.

  • How to change the background color of some rows in a Datagrid?

    How to change the background color of some rows in a Datagrid?

    Hee is an excellent example:
    http://www.CFLEX.NET/showfiledetails.cfm?channelId=1&object=file&ObjectID=487

    Tracy

  • How to change the background color of a line when you have the selection of cells in tableview?

    I have a tableview and I chose the selection of cells. How can I change the background color of a line, if I select a cell?

    The usual example using:

    import javafx.application.Application;
    import javafx.beans.binding.Bindings;
    import javafx.beans.binding.BooleanBinding;
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.property.StringProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ListChangeListener.Change;
    import javafx.collections.ObservableList;
    import javafx.collections.ObservableSet;
    import javafx.css.PseudoClass;
    import javafx.geometry.Insets;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.SelectionMode;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TablePosition;
    import javafx.scene.control.TableRow;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Font;
    import javafx.stage.Stage;
    
    public class RowHighlightedCellSelectionTableViewSample extends Application {
    
        public static void main(String[] args) {
            launch(args);
        }
    
        @Override
        public void start(Stage stage) {
            Scene scene = new Scene(new Group());
            scene.getStylesheets().add(getClass().getResource("selected-row-table.css").toExternalForm());
            stage.setTitle("Table View Sample");
            stage.setWidth(450);
            stage.setHeight(500);
    
            final Label label = new Label("Address Book");
            label.setFont(new Font("Arial", 20));
    
            final TableView table = new TableView<>();
            final ObservableList data =
                FXCollections.observableArrayList(
                    new Person("Jacob", "Smith", "[email protected]"),
                    new Person("Isabella", "Johnson", "[email protected]"),
                    new Person("Ethan", "Williams", "[email protected]"),
                    new Person("Emma", "Jones", "[email protected]"),
                    new Person("Michael", "Brown", "[email protected]")
            );
    
            table.getSelectionModel().setCellSelectionEnabled(true);
            table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    
            final PseudoClass selectedRowPseudoClass = PseudoClass.getPseudoClass("selected-row");
            final ObservableSet selectedRowIndexes = FXCollections.observableSet();
            table.getSelectionModel().getSelectedCells().addListener((Change change) -> {
                selectedRowIndexes.clear();
                table.getSelectionModel().getSelectedCells().stream().map(TablePosition::getRow).forEach(row -> {
                    selectedRowIndexes.add(row);
                });
            });
    
            table.setRowFactory(tableView -> {
                final TableRow row = new TableRow<>();
                BooleanBinding selectedRow = Bindings.createBooleanBinding(() ->
                        selectedRowIndexes.contains(new Integer(row.getIndex())), row.indexProperty(), selectedRowIndexes);
                selectedRow.addListener((observable, oldValue, newValue) ->
                    row.pseudoClassStateChanged(selectedRowPseudoClass, newValue)
                );
                return row ;
            });
    
            TableColumn firstNameCol = new TableColumn<>("First Name");
            firstNameCol.setMinWidth(100);
            firstNameCol.setCellValueFactory(new PropertyValueFactory<>("firstName"));
    
            TableColumn lastNameCol = new TableColumn<>("Last Name");
            lastNameCol.setMinWidth(100);
            lastNameCol.setCellValueFactory(new PropertyValueFactory<>("lastName"));
    
            TableColumn emailCol = new TableColumn<>("Email");
            emailCol.setMinWidth(200);
            emailCol.setCellValueFactory(new PropertyValueFactory<>("email"));
    
            table.setItems(data);
            table.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
    
            final VBox vbox = new VBox();
            vbox.setSpacing(5);
            vbox.setPadding(new Insets(10, 0, 0, 10));
            vbox.getChildren().addAll(label, table);
    
            ((Group) scene.getRoot()).getChildren().addAll(vbox);
    
            stage.setScene(scene);
            stage.show();
        }
    
        public static class Person {
    
            private final StringProperty firstName;
            private final StringProperty lastName;
            private final StringProperty email;
    
            private Person(String fName, String lName, String email) {
                this.firstName = new SimpleStringProperty(fName);
                this.lastName = new SimpleStringProperty(lName);
                this.email = new SimpleStringProperty(email);
            }
    
            public String getFirstName() {
                return firstName.get();
            }
    
            public void setFirstName(String fName) {
                firstName.set(fName);
            }
    
            public StringProperty firstNameProperty() {
                return firstName ;
            }
    
            public String getLastName() {
                return lastName.get();
            }
    
            public void setLastName(String fName) {
                lastName.set(fName);
            }
    
            public StringProperty lastNameProperty() {
                return lastName ;
            }
    
            public String getEmail() {
                return email.get();
            }
    
            public void setEmail(String fName) {
                email.set(fName);
            }
    
            public StringProperty emailProperty() {
                return email ;
            }
        }
    }
    

    And then the selected line - table.css:

    .table-line-cell: {selected row

    -fx-background-color: lightskyblue;

    }

  • Change the highlight color when you select files or folders

    Hello
    Need assistance to change the highlight color when you select files or folders in Windows Explorer / my document.
    I use Windows Vista with SP2.  I tried to go to control-online personalization panel => color & appearance of the window and changing the settings.  However, I can't change the intensity of the highlights that I see it clearly.  A little blind colours, I would like to change the color to make it darker so that I could clearly see when an item is selected.
    I tried open classic appearance for color options properties more-online advance but did not find an appropriate under "Item" option that I could change.  I tried the step "Selected items" under ' point:' but that only applies when I double click on a file or folder.
    Any advice would be greatly appreciated.
    The

    Salvation of

    Sorry to hear that the option is good enough for you.  I've done some research more and that you still do not see a way to change what you're asking.  As I said before, others have mentioned this issue as well.  If I come across a way to do it, I'll post it here.

    In the meantime, I'm going to Mark this post as answer whose answer is:

    Currently, there is no way to make this change in Windows Vista.

    Thanks for posting on Microsoft Answers.
    Ken
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to change the highlight color for windows 7 (select the file or folder)?

    How to change the highlight color for windows 7 in the aero theme (select the file or folder)?

    You can change the font size because it is not a widget.   To do this:

    1 type dpi in your Start menu search box, and then choose make text and other more or less important.
    2 - Choose a size you prefer
    3 - Click on apply.
  • Change the background color for a selected item in a ListView?

    Hello

    No idea how to change the color of tbackground of a ListView selected item to blue for a different color?

    I tried wrapping the ListView in a container, then by changing the background color of the container, but it does not work. And ListView, nor the ListItemComponent takes a background attribute.

    Thank you

    Oh, I did that last night.
    Thus, in the container for StandardItem, add this line:

     background: ListItem.selected || ListItem.active ? Color.create("#4D9EC9") : Color.Transparent
    

    and onTriggerred of the signal, add two lines:

    // for highlighting
    listView.select(indexPath, true);
    
    // for clearing highlight
    listView.clearSelection();
    

    PS: listView is the id of the ListView

    ListView {
        id: listView
    ....
    
  • Change the default selection highlight color

    Hi all

    Is it possible to change the color of the default selection (virg) of another color?

    Thank you

    Sandeep

    Hello

    You cannot change the selection color.

    This selection is the same on emulators IE blue but on the device, he can distinguishes itself from pink to blue, plu yellow I guess it depends on the theme

    Located on the phone.

    You can do a thing, you can override this component paint individual and change the accent color.

    Maybe this will help you.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=12904&query.ID=99...

  • Whenever I select a color she will change to grey or black [was: Please help.]

    Whenever I select a color that she will change in gray or black, I don't know if this is a bug or not?

    You have selected an adjustment layer?

    What type of image is the document?

  • Change the background color of the table rows af of those who have a larger date today

    Greetings,

    I have a table of af of insurance of the person which show details for each insurance policy. I have change the sql query table to show only those that the insurance is still active ('end_date' variable is greater than today).

    Everything works fine, but on doubts, I want to show all the records, but change the background color red of those lines which have expired ('end_date' variable less today).

    Can you help me please?

    Thanks in advance.

    Using Jdeveloper v11.1.2.4.0 (JSF - components of the ADF)

    This example shows how to do this http://andrejusb.blogspot.de/2010/04/changed-row-highlighting-in-oracle-adf.html

    Timo

  • How to change the background color of selection of the selected item in the drop-down box of choice?

    How to change the background color of selection of the selected item in the drop-down box of choice?

    By default, the selection background color like 'blue', but if I want it to be "yellow" for example, how should I do?

    Thank you

    The id is applied by (I think) the skin of the ChoiceBox class. You don't need to define.

    You must apply the css in an external style sheet. You can apply the external style sheet to any parent of the box of your choice, or on-site (the most usual way to do it).

    Example:

    import java.util.ArrayList;
    import java.util.List;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class ChoiceBoxTest extends Application {
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
    
        final ChoiceBox choiceBox = new ChoiceBox<>();
    
        List tempResult = new ArrayList();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        }
        choiceBox.getItems().setAll(tempResult);
    
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    
    }
    

    choiceBox.css:

    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
     -fx-background-color: yellow ;
    }
    #choice-box-menu-item .label {
     -fx-text-fill: black ;
    }
    

    Post edited by: James_D

  • With the help of Adobe Acrobat Pro XI: is there a way to select existing text / change the font color of this

    With the help of Adobe Acrobat XI Pro Trial Version: is there a way to select existing text / change the font color of the text?  (there are here - but where is it to XI pro?)

    I have been using Acrobat 8 Pro & it's very simple, but I was not able to do using Pro XI!

    1. Open the PDF file
    2. Click on the Tools Menu
    3. Click the editing of content
    4. Choose text & Images

    They wanted to make it easier to get.

  • How can I configure only the first row of a DataGrid as the selected line?

    I have a "Go" button on a search form that retrieves data in a grid, already linked to data.  After the data is read, I want to make the first line in the Datagrid control in the selected row, as if the user has clicked on it.  If the result set is empty, I don't want the code down.  (I want only one line can be selected at a time)

    protected function btnGo_clickHandler(event:MouseEvent):void
    {
    getSBJsResult.token = baa_data_svc.getSBJs (cmbSrch.text);

    grdSBJs. //  ?????  What is happening here to select the first line?
    }

    That should do it.

    If this post has answered your question or helped, please mark it as such.

    If (myDataGrid.dataProvider.length > 0) {}

    myDataGrid.selectedIndex = 0;

    }

  • Dynamically select all the rows in a DataGrid

    Is there a simple way to select all the rows in a DataGrid dynamically?  I want to select all the lines as soon as the DataGrid control is created.

    Thank you!

    Lee

    This code should answer your question.

    If this post has answered your question or helped, please mark it as such.

    
    
       
       
       
       
          
             
             
             
          
       
    
    

Maybe you are looking for

  • How will I know if I am under the RC 1?

    I just downloaded what I thought was v 4 RC 1. I was already running Beta 4. However, the view button is not presented, and when I look for more information on what version I am running, it just says: 4.0. I tried to reinstall. When I installed both

  • Help to start the iMac iBook Pro hollow

    Please help me! MY iMac does not or exectly what the screen shows the emblem of Apple. Therfore the iMac does not work. My suggestions are that this iMac has more then just a problem. I think my keeboard is also broken. What can I do? 1. is it possib

  • Windows Installer only installs an older DLL

    I use an application with the 1.0.33.1 version, my previous one was 1.0.32.1 but unfortunately some dll in previous versions are like 32.1.0.0 (made a mistake when creating that msi). If during the installation, MSI has not installed correctly, so I

  • CLOSED

    This topic is closed.

  • I couldn't access .xps files

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! The ideas that I have confirmed that the box of the NET framework 3.5 program has checked XPS. any ideas on research and opening the xps files.