3 Replies Latest reply on Aug 7, 2007 7:40 AM by Handycam

    Displaying alternate value in datagrid?

    Handycam Level 1
      I have a datagrid. Its data provider is an XML list from an external XML file. Works fine. I am displaying an attribute "@ln2" as the datafield.

      What I need to do is "save" the selection in this datagrid and display it in a second datagrid, but show DIFFERENT attributes of this item, @ln2 and @units.

      Currently, I have been using the first grid's selectedItems property. But this is, of course, an array and doesn't store all the attributes, just what was clicked on in the grid.

      So how do I show the same dataset, with the selected item only, but the alternate data attribute?

      I know the display part, just set the datafield to be @ln2. But I need to access the whole XMLList, right? That's where I'm stuck.

      Thanks.
        • 1. Re: Displaying alternate value in datagrid?
          ntsiii Level 3
          I am not following.

          Is the first DG multi-select? If so, and you select 3 rows, how many rows should display in the secong DG?

          I do not understand this, "the same dataset, with the selected item only" at all. What is the "dataset"? If you are showing a "selectedItem" (single item), why are you using a datagrid?

          Tracy

          • 2. Re: Displaying alternate value in datagrid?
            Handycam Level 1
            By dataset, I mean an XMLList variable that's been populate by an XML file.

            My XMLList contains a list of items with multple attributes.

            In one datagrid, I want to display one attribute of the items. The user clicks on one or more items, clicks a button.

            Then I want a second datagrid to display the selected items, but different attributes of the objects displayed.

            For example, say I have sneakers. The XML file is a list of sneakers, ewch node with attributes for all the relevant info about the sneakers.

            The first data grid just shows "brand/mode" field in one column. The user picks 2 different Nike sneakers. Click a button.

            The second datagrid needs to show those sneakers, but now the "price", "description", and "available" attributes need to be displayed in columns.

            I have tried just creating the second grid, set to display selectedItems from the first grid. However, the additional columns are coming up blank -- that's my problem.

            The first DG has a column with datafield "@brand", the second has "@price", "@description" etc.

            So perhaps I can't display the selectedItems? Do I have to use the original XMLList as the dataprovider for the second grid?
            • 3. Re: Displaying alternate value in datagrid?
              Handycam Level 1
              Never mind, I think I've got it figured out.