Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6014555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:42:32+00:00 2026-05-23T02:42:32+00:00

I have a form that consists of two data grids and a button. Datagrid

  • 0

I have a form that consists of two data grids and a button. Datagrid 1, “myStaticDataGrid”, has values I have added for the user to select from. I want the button’s click event to send the current selection of myStaticDataGrid to the second datagrid, “myDataGrid”. I have been able to accomplish this if I use a text box and a datagrid but I am having trouble finding the right syntax to grab the selection data from myStaticDataGrid.

This is my attempt using the two datagrid approach:

<s:Form id="myForm">
//The values from this grid are determined once the button is clicked.
  <s:FormItem id="myDataGrid">
    <s:DataGrid id="bdgFormData">
      <s:typicalItem>
        <s:DataItem formData="Description" xmlData="Value"/>
      </s:typicalItem>
      <s:ArrayCollection id="values"> </s:ArrayCollection>
    </s:DataGrid>
  </s:FormItem>


//The values from this grid are determined at runtime.
<s:FormItem id="myStaticDataGrid">
    <s:DataGrid id="userSelects">
        <s:typicalItem>
            <s:DataItem selects="Typical Item" codes="0000"/>
        </s:typicalItem>

        <s:ArrayCollection id="selects">
            <s:DataItem selects="Y" codes="1"/>
            <s:DataItem selects="N" codes="0"/>
        </s:ArrayCollection>
    </s:DataGrid>
</s:FormItem>

<s:FormItem label="Add Selects">
    <s:Button label="Go" click="addData(event)"/>
</s:FormItem>

My AS event to send the data:

protected function addData(event:MouseEvent):void
{

  //Put selected data at the top of the grid.
  items.addItemAt(lstFormData.typicalItem,0)

}

My question is where do I bind the grid data?

This is how I send the textbox data to a the datagrid:

<s:FormItem label="myDataUtil">
  <s:Label text="Value"/>
  <s:TextInput text="@{lstFormData.typicalItem.formData}"/>
</s:FormItem>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:42:33+00:00Added an answer on May 23, 2026 at 2:42 am

    I whipped this up for you unfortunately I only have flex 3 here so you will have to make conversions for whatever you need but you should get the idea of how it works.

    <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      [Bindable]
      public var originalData:ArrayCollection
    
      [Bindable]
      public var changingData:ArrayCollection;
    
      public function init( ):void{
        this.changingData = new ArrayCollection( )
        this.originalData = new ArrayCollection( )
        for( var i:int = 0;i<100;i++){
          var obj:Object = new Object( )
          obj.label = 'slot '+ i;
          obj.value = 's'+i;
          originalData.addItem( obj );
        }
      }
    
      public function onSelect( e:Event ):void{
        this.changingData.addItem(( e.currentTarget as DataGrid).selectedItem )
      }
    
      ]]> 
      </mx:Script>
    
    <mx:DataGrid id="myStaticDataGrid" dataProvider="{originalData}"  click="onSelect(event)"/>
    <mx:DataGrid id="bdgFormData" dataProvider="{changingData}" x="240" y="0"/>
    
    </mx:Application>
    

    Here is an example without binding data

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
    
                public function onSelect( e:Event ):void{
                    var targetProvider:ArrayCollection = ( bdgFormData.dataProvider as ArrayCollection )
                    if( !targetProvider ){
                        targetProvider = new ArrayCollection()
                    }
                    targetProvider.addItem(( e.currentTarget as DataGrid).selectedItem )
                    bdgFormData.dataProvider = targetProvider
                }
    
        ]]> 
    </mx:Script>
    
    <mx:DataGrid id="myStaticDataGrid" click="onSelect(event)" >
        <mx:dataProvider>
            <mx:ArrayCollection >
                <mx:Object label="AIR" />
                <mx:Object label="ColdFusion" />
                <mx:Object label="Dreamweaver" />
                <mx:Object label="Flash" />
                <mx:Object label="Flex" />
                <mx:Object label="Photoshop" />
            </mx:ArrayCollection>
        </mx:dataProvider>
    </mx:DataGrid>
    <mx:DataGrid id="bdgFormData" x="240" y="0"/>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have complex form that I want to make more user friendly. It consists
I have a UserControl that consists of three TextBoxes. On a form I can
I have a form that has multiple fields, and for testing purposes is there
We have a form that allows a user to filter a list with by
i have a form that consist of two textfield and one combobox. i want
I have a simple input form that consists of a single textbox and an
i have a submit form that consist of 1 group radio button. <div id=defectclass>
I have two forms, let's call them Main and Form2 . Main form consists
I have a large form that consists of all the input (text, checkbox, radio,
I need to have a user form that is larger than the screen. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.