1 Reply Latest reply on Oct 8, 2007 5:13 PM by chris.huston.t10

    Setting selected property of checkbox

    Mark Forsberg Level 1
      I'm trying to set the selected property of a checkbox based on a value in a datagrid. This function is called by an itemClick event:

      <mx:DataGrid x="283" y="34" height="482" id="dg_drivers"
      dataProvider="{getMyDrivers}" itemClick="dg_drivers_ClickEvent(event);">

      The following loads my textboxes correctly, but will not set the selected property of the checkbox.

      private function dg_drivers_ClickEvent(event:ListEvent):void{
      Alert.show(event.currentTarget.selectedItem.cbActive);
      pnl_modDriver.visible = true;
      tb_modLastName.text = event.currentTarget.selectedItem.LastName;
      tb_modFirstName.text = event.currentTarget.selectedItem.FirstName;
      cb_modActive.selected = event.currentTarget.selectedItem.cbActive;
      }

      The alert shows true or false.

      I have also tried binding the checkbox's selected property:

      cb_modActive.selected = " {dg_drivers.selectedItem.cbActive}"

      Could someone point me in the right direction?
      Thanks.

      Mark F.