4 Replies Latest reply on Jun 14, 2008 9:53 AM by kamleshgk

    Combo Box SelectedValue

      Hi ,
      I'm a Flex beginner. I have a question.

      So, This is my XML
      <Project data="1" ProjectName="BixPart"></Project>
      <Project data="2" ProjectName="Payroll Online"></Project>
      <Project data="3" ProjectName="Lunch"></Project>

      And i bind this to the combo box
      <mx:ComboBox width="200" horizontalCenter="0" id="projectPicker" dataProvider="{xdata..Project}" />

      Now on click of a button, i can say projectPicker.Text will give me the "ProjectName".
      How can i get the selected value ("1", "2", "3")?

      In C# and .NET we have DisplayMember and ValueMember properties. And SelectedValue property will give us the selected value.

      Can anyone please tell me how to get the selected value? Any code examples would be appreciated.