Programmatically change selected cell/row of multicolumn listbox

I want to programmatically change the selected cell of a multicolumn list box whose Selection Mode is set to Highlight Entire Row.  I would use this to be able to highlight which ever row of the listbox I choose to.  It would function in the same manner as if the user had clicked on a row to select it and highlight that particular row.  Setting the Active Cell does not accomplish this.
Steve
Solved!
Go to Solution.

Assigning the Value property works to change the selected and highlighted row.  Thanks

Similar Messages

  • How to read 'clicked header' AND selected row from multicolumn listbox?

    I have a multicolumn listbox filled with 6 columns and about 500 rows.
    I want the user to be able to click on a column header, and sort the listbox alphabetically on that column. I've written the code for that, and that works. (using the 'itemnames' en 'get clicked col hdr' properties.)
    However, I also want to include the option, that when a user highlights a row, and then clicks on the header, that after the listbox gets sorted it scrolls down to the selected row.
    (So that the user doesn't have to search for it)
    And that's where things go wrong, because the value of the listbox changes to zero when you click on a column header. No I idea why it does that, but it's rather
    annoying. Can I change that behaviour somehow?
    Or any ideas how to get around it?

    My thanks to you and Jared.
    Seems I got a working solution now.
    Did take a while to figure out why your solution worked. Basicly, you're reading the row from a few iterations before.
    As soon as I understood that, I simplified it a little. Look at the attached file... I think it does the same. :-)
    Jared asked for the sorting routine. As I don't seem to be able to attach files when replying to comments, I took the liberty to include it here also.
    Basicly, I just use the 'sort 1D array' that comes with Labview 6. To be able to sort a 2D array, I convert every row to a cluster. That's something the 'sort 1D array' VI can handle nicely.
    To sort on the correct column, I just cut all columns in front, and paste them behind again. A
    fter sorting, I reverse the process.
    Anthony.
    Attachments:
    copy2_of_multicolumn.vi ‏26 KB
    sort_2d_string_array.vi ‏34 KB

  • How to programmatically change the cell color of an ADF table ?

    Hi all,
    I have an ADF table with some fields on it. Depending on the value of a field named, say, "F1", I would like to change its background color.
    So far I can change the field color with this EL expression inside the InlineStyle table column property:
    font-size:medium; background-color:#{viewScope.myBean.setColor};
    where setColor is a bean function, in where I access the field "F1" via binding, parse its value, and return the right value - so far, so good.
    The bad thing is, the InlineStyle affects that field in all the rows of the table, while I would like to change only the field in the rows, which have that specific value in it.
    So for example having the rows:
    F1
    abc#1 ----> currently selected row
    cde#2
    efg#3
    I want to change the background color to all the F1 fields which have a "1" after the '#' and let the other "F1" row cells background color stay unchanged.
    But as you can imagine, the InlineStyle affect the "F1" background color in all the rows (assuming that the first row of the table is selected).
    So the question: how to access a single cell of a row in an ADF table, and programmatically change its background color ?
    So far I can iterate through the ADF table with:
    BindingContext bindingctx = BindingContext.getCurrent();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("aTableIterator");//access the iterator by its ID value in the PageDef file
    RowSetIterator rsi = dciter.getRowSetIterator();
    System.out.println("rsi getrowcount = " rsi.getRowCount());+
    Row row = null;
    +if (rsi.getRowCount() > 0) {+
    row = rsi.getCurrentRow();
    System.out.println("row attr = " Arrays.toString(row.getAttributeNames()));+
    System.out.println("class : " row.getAttribute("F1").getClass().toString());+
    +}+
    +while (rsi.hasNext()) {+
    row = rsi.next();
    System.out.println("row attr = " Arrays.toString(row.getAttributeNames()));+
    +}+
    Regards,
    Sergio.

    Hi,
    I mean a specific cell within a row.
    Here are two pictures that show an ADF table with two rows and some fields on it:
    https://skydrive.live.com/?cid=7D3084D8BF755808&id=7D3084D8BF755808!107&sc=documents#cid=7D3084D8BF755808&id=7D3084D8BF755808!107&sc=documents
    bild_A is what I have, bild_B is what I would like. Note that:
    in bild_A the first row contain a yellow background color for the field F4 and an orange background color for the field F5. This is correct, because F4 has an "1" at the end of its string value, and F5 has a "3" at the end. So far so good.
    But the second row (again, bild_A) has also the fields F4 with yellow background color, and the field F5 with orange background color, even if the value in both fields is 0.
    What is should be, is shown in bild_B.
    The problem is that the solution provided affects all the cells of the column, while I need to change the background color of a single cell, and leave the other unchanged (see bild_B).
    I hope that clarify a bit :)
    Sergio.

  • Help - Edit cell of a multicolumn listbox at run time

    Hi All,
    I am populating rows and columns of a multicolumn listbox from a file at run time. However, after the data is loaded in the listbox I want to have the option of changing cell value.
    Can I do that? If so, how?
    I appreciate your time and help.
    Thanks,
    Mim

    Hi,
    You have to use the property item names witch is a 2D string array.
    Then replace the elements you want to change in that array and write it back to the table.
    Check attachment.
    Hope it helps,
    Paulo
    Attachments:
    ChangeTableElements.vi ‏20 KB

  • How keep the font and color from changing in cells/rows?

    I find it extremely annoying that when I remove the contents of a cell, the blank cell no longer retains the font & color settings of what had been there before. This is a problem I have both in day to day use and in starting a new document on the basis of an old one. Every month I start a couple of new documents for the month, and I use the ones of the previous months as the point of departure, since everything is set up. But each time I have to reset all the colors and fonts (I have different colors for each row), and it is time consuming and annoying. Why can't I just set the values of all the cells containing number values back to zero without changing the settings?? Or can I but don't know how?
    I never had this problem with Excel or with the Appleworks spreadsheet.
    Another problem I have is deleting a single cell in order to align the rows or columns; again, this was simple in Appleworks, and you have the option of the remaining cells moving up or down or left or right. But I can't figure out how to do this simple thing in Numbers.

    calmeforet wrote:
    I find it extremely annoying that when I remove the contents of a cell, the blank cell no longer retains the font & color settings of what had been there before. This is a problem I have both in day to day use and in starting a new document on the basis of an old one. Every month I start a couple of new documents for the month, and I use the ones of the previous months as the point of departure, since everything is set up. But each time I have to reset all the colors and fonts (I have different colors for each row), and it is time consuming and annoying. Why can't I just set the values of all the cells containing number values back to zero without changing the settings?? Or can I but don't know how?
    From my point of view, you are using Numbers the bad way.
    Create a template with the wanted attributes and start from the template every month.
    So you will have the wanted features which is not the case with your "reuse_an_olddoc" scheme.
    Another problem I have is deleting a single cell in order to align the rows or columns; again, this was simple in Appleworks, and you have the option of the remaining cells moving up or down or left or right. But I can't figure out how to do this simple thing in Numbers.
    It appears that you didn't search in the good area. Searching in the existing thread (as asked by the Terms of use) would have give the response.
    Yvan KOENIG (from FRANCE dimanche 13 avril 2008 15:57:32)

  • ViewStack programmatically changing selected item

    Hi Guys or Ladies
    New to flex and here is my scenario:
    Using a ViewStack that has multipule custom componentes (forms) in it.
    I have a diffrent navigation control that when clicked should preform two simple tasks.
    1. Change the viewstack selected item according to the clicked item in the navigation control.
    2. Bind Specific data to the inner custom component in the viewstack that should be set to selected already.
    Sounds simple ... but for some reason  unknown to me.
    After I set the viewstack selectedchild to the right custom component
    when I try to bind my data to that component I see that the change in the viewstack has occurred yet
    and the component is still null;
    Here is the code.
    private function NavigationControl_ItemClick(event:MyCustomEvent):void{ 
    //change viewstack selectedChild
    MyViewStack.selectedChild = ThisSpecificComponent;
    //Bind Data to the new created instance of component in the viewstack
    ThisSpecificComponent.data = event.data;
    Thanks

    Set components creationPolicy value to "All" This property initialize all components inside the container, so you dont get null object reference.

  • Problem selecting table rows/cells in Indesign CC

    I have a problem when trying to select rows and cells within tables created in Indesign CC. I am using a Macbook Pro on OSX 10.9.4.
    As you can hopefully see from the image attached, I am unable to select cells & rows cleanly. Believe it or not the image attached shows the last 2 rows of the table selected. As I drag the cursor to highlight the cells/rows I want the highlighted section jumps all over the place so it is not clear which section of the table is actually selected.
    If anyone has any suggestions as to what might be causing this I would appreciate your thoughts.
    Thanks
    Craig

    I believe you should be on 9.1, this issue existed in that version and has been fixed in 9.2.1
    I would recommend that you upgrade InDesign CC to at-least 9.2.1
    Thanks
    Javed

  • Disable horizontal scroll in multicolumn listbox

    I'm using a Multicolumn listbox and I programmatically change the cell to be edited using UP, DOWN, RIGHT and LEFT keyboard keys.
    Everything is working exept for the rightmost column: when I press the RIGHT key, the cursor moves to the next cell inside the rightmost column but all the table scrolls to the right (even if not really necessary) preventing the user from seeing the first column (leftmost). Is it possible in some way to lock or totally disable the horizontal scroll?
    Every idea would be welcome.

    I don't think there's a way to completely disable scrolling (once you ask the MCLB to show you a cell, it will probably do whatever it can to show it to you), but you can start by making the scrollbar invisible and by setting the Top Left Visible Cell property to [X, 0] every time you move a cell. If this doesn't work, you should upload your code. We play better when we have what to work with.
    Try to take over the world!

  • How to insert the data to selected cell in multicolumn

    Hello Labviewer
    I am new for labview, and have a problem when i am using a multicolumn listboxes, how can i insert the data to my selected cell,
    something like
    header      XXX   

    mengyi
    The property node of the listbox has a "Item Names" property. This is a two dimensional array corresponding accordingly to the row by column listbox. You can modify this array to change the listed string for the selected cell(s).
    --Russ

  • How do I change the colour of a selected cell in a jTable?

    I have a Jtable that displays URL names in one column. There are several problems I'm having. The effect I'm trying to achieve is this:
    When the user runs the mouse over the URL name the cursor should change into a hand (similar to what happens in an HTML hyperlink). I'm aware that the Cursor class can set the cursor graphic so i figure that i need a listener of some sort on each cell (so the cursor can change from an arrow to a hand) and also one to indicate when the cursor is not on a cell (so that it can change from a hand back into an arrow). Is this the right track?
    Also, I've looked at the DefaultTableCellRenderer class (which, as i understand it, is responsible for how each cell in the jtable is displayed) for a method that will allow me to set the background of a selected cell (or row or column). I require this because each time i select a cell (or row) it becomes highlighted in blue. I would rather it just remained white and changed the cursor to a hand. I know there exists a method for setting the background for an unselected cell but none for a selected cell. Again, I'm not sure if I'm going down the right track with this approach.
    Lastly, if the cell has been selected (by a mouse click) the font of the writing in the cell (i.e. The name of the URL) should change. This shouldn't be too much of a problem I think.
    I do not expect anyone to provide code to do all of this but some general pointers would be extremely helpful as I do not know if I'm thinking on the right track for any of this. Having some (limited) experience with Swing I doubt there is a simple way to do this but I can only hope!
    Thanks.
    Chris

    http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
    there you can find some examples with CellRenderer's and so on ...
    have fun

  • Change JTable's row color on row selection

    Hello!
    Everywhere I've looked they're only explaining how to draw rows in different colors WHEN THE TABLE IS BEING CREATED, via prepareRenderer.
    But that is not what I am looking for. What I want is to actually change the row's color after the table has been drawn/rendered/whatsoever. For instance, when the user clicks on that row. The default behaviour is for the row to become blueish, but, when the user selects another row, the first selected row turns back to white. I would like to prevent that from happening. I want the row to become FIRE RED when the user clicks on it, and I want the row to remain like that for good, even when the user selects a different row. Do I make any sense here? :-)
    Thank you for your time and future suggestions.

    Everywhere I've lookedApparently you didn't look in the Swing forum, because thats where Swing related questions should be posted.
    but how do I assign a cell renderer to an entire row/table ?The easiest way is to use the prepareRenderer(...) method you have already found. My "TablePrepareRenderer" class (which you can find by searching the Swing forum) shows you how to do this.
    You will note that the color of the row is determined by data in the table. So all you need to do is add another column in the TableModel that contains the information you need to determine the row color. That column can be removed from view in the table by removing the TableColumn from the TableColumnModel.

  • How to change the text size of a multicolumn listbox ?

    I would like to have all text in my multicolumn listbox biger and bold. I don't find anything with property node.

    Hi
    Use the Positioning tool to select the entire Multicolumn Listbox. Then use the Text Settings in the LabVIEW toolbar to change the font, style and so on. You will see that the font of all the items in your Multicolumn Listbox (including its label) are changed at once.
    If you want to change only one item, than you can use the Text tool.
    Luca P.
    Application Engineer
    National Instruments
    Regards,
    Luca

  • Changing Colour of only selected cells in MS excel..??

    Hi,
    I read in SAP Help that it is possible to change formatting (colour, border etc) for few cells using style sheets, so after doing the required changes and storing it under new style name when I press SAVE on screen 3 of layout builder it changes the colour for all the other cells in my layout sheet..and if i rerun the layout if all the cells come in the changed color..plzz give me any suggestion how to go about doing it..??
    and is there any way to insert subheadings/rows in my layout..?..I am only able to do it by making the row as comparison column which requires me to assign some values in all my lead columns for that specific row..which looks just same like any other row but I just want it as subheading.
    Please advise..
    Thanks & Regards
    Rohit

    Hi Rohit,
    When you change the style it will change all other cells with the same style.  The only way I know of to change specific cells is to use the VB exits provided.  This will only work if you are not using the web.
    As for your row.  If you have defined the layout as one with specific row definitions you can create blank lines in the layout by giving a row number with no selections.  You can then put your sub-heading directly in the excel.
    Mike.

  • Row headers string in a multicolumn listbox

    Hello!
    I'm using multicolumn listbox block and I want to put row headers, but I don't Know how.
    I'm using the node property block to put column headers...but I don't find for rows.
    Someone knows what I have to do?
    Thanks a lot!

    I don't think there is a row header property like the column header, you can leave the first row blank and white the headers in the first column so simulate it.  You can create a simple subvi which takes a reference to the control and a string array and in a for loop set the string value of cell (0, i) to the value of the string[i] array input.  As far as I know there is not a row header like there is a column hearer though.  This is typical in spreadsheets where the rows are indexed and not named but the columns are.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Changing JList cell renderer on selection

    Hi,
    In our application we need to change the renderer of the selected cell of JList to JTextArea while maintaining default cell renderer for unselected cells. I tried by providing custom cell renderer (code is given below) but it does not work..:-(. Though the component used by JList for rendering the cell is JTextArea, the height of the cell remains same as that of unselected cells. Our requirement is to change the cell height of the selected row so as to give a feel that selected row expands and shows some more information about the selected item to the user.
    Here is the code snippet of the cell renderer that I wrote:
    class CellRenderer1 extends DefaultListCellRenderer{
    private JTextArea selTxtArea;
    CellRenderer1() {
    selTxtArea = new JTextArea(3,20);
    this.setOpaque(true);
    public Component getListCellRendererComponent(JList list,
    Object value, int index,
    boolean isSelected, boolean cellHasFocus) {
    String name = (String) value;
    if ( isSelected ) {
    selTxtArea.setBackground(list.getSelectionBackground());
    selTxtArea.setForeground(list.getSelectionForeground());
    selTxtArea.setText(name + "\n" + name);
    return selTxtArea;
    else {
    this.setBackground(list.getBackground());
    this.setForeground(list.getForeground());
    this.setText(name);
    return this;
    //return this;
    Any pointers or help will be highly appreciated.
    Thanks
    Atul

    JList calculates fixedCellHeight and then uses the same for every cell. This was causing the problem. By overriding the getRowHeight method of BasicListUI class I was able to achieve different cell heights for selected and unselected rows. Following is the code snippet which shows how this was achieved:
    protected int getRowHeight(int row) {
    if ( (cellHeights == null) || (cellHeights.length < row )) {
    cellHeights = new int[row];
    ListModel model = list.getModel();
    Object value = model.getElementAt(row);
    ListSelectionModel selModel = list.getSelectionModel();
    boolean isSelected = selModel.isSelectedIndex(row);
    Component comp = list.getCellRenderer().
    getListCellRendererComponent( list, value, row,
    isSelected, false);
    Dimension dim = comp.getPreferredSize();
    int height = dim.height;
    cellHeights[row] = height;
    return cellHeights[row];
    }

Maybe you are looking for

  • Can PDFGenerator convert a fillable PDF file to an editable HTML form?

    Will it convert validation as well? Thanks, Omar

  • Template problems

    I am trying to make a template for a new site that I am working on using DW CS3. I started with the home.html page then saved it as a template. Have since been edditing the template. Started with using tables to positions the elements. Have 4 editabl

  • Problem with downloading trial

    When I try to install the trial version of Dreamweaver cs6 I always get these errors: ERROR: DW051: Dependency of session payload {A4ED5E53-7AA0-11E1-BF04-B2D4D4A5360E} Dreamweaver Adobe Dreamweaver CS6 12 has changed. ERROR: Media DB Error : 12 What

  • Some of my music is incompleet, some of my music is incompleet

    Some of my music is cut short

  • JScrollPane won't work, help

    I have a problem with a JScrollPane, it appears on the frame but it wont scroll down when it's to much text in the textarea, can someone help me!? import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import ja