0 Replies Latest reply on Jan 5, 2010 6:12 AM by mawni1980

    CTRL + Click On DataGrid Row Throws An Exception of Null!

    mawni1980 Level 1

      Dear All

       

      I found a something than can be called common bug in Adobe Flex and Air, this is the case that happens

      1. Select any row from datagrid

      2. Hold CTRL

      3. Click On Row,(Usually the content of this row must be copied to text fields in-order to update it) but while pressing CTRL, it will throw in exception of null!

       

      Can Any One Solve This, we have already built huge project on flex, all using more than 50 datagrids in many places, so this must be solved some how?

       

      this is a sample code which also cause the problem

       

      private function sendToUpdate(e:ListEvent):void

      {

      txtAgentName.text=dgSerachResult.selectedItem.name;

      txtAgentID.text= dgSerachResult.selectedItem.agentID;

      txtAgentAddress.text= dgSerachResult.selectedItem.address;

      cmbCountry.selectedItem= {name:dgSerachResult.selectedItem.countryName};

      txtContactPerson.text= dgSerachResult.selectedItem.contactName;

      txtAgentMphone.text= dgSerachResult.selectedItem.contactMobile;

      txtAgentPhone.text = dgSerachResult.selectedItem.contactTel;

      cmbAgentStatus.selectedItem={data:dgSerachResult.selectedItem.agentStatusId};

      cmbAgentType.selectedItem={ID:dgSerachResult.selectedItem.agentTypeId};

      txtEmail.text = dgSerachResult.selectedItem.email;

      txtNotes.text = dgSerachResult.selectedItem.note;

      }

       

      <mx:DataGrid id="dgSerachResult" itemClick="{sendToUpdate(event)}" x="10" y="10" fontSize="8" width="645" color="#000000" fontWeight="bold" borderColor="#000000" height="106" toolTip="Select Agent To Update It" resizableColumns="false" wordWrap="true" draggableColumns="false" allowMultipleSelection="false">

      <mx:columns>

      <mx:DataGridColumn width="{dgSerachResult.width*0.04}" headerText="ID" dataField="agentID"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.21}" headerText="Name" dataField="name"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.1}" headerText="Type" dataField="typeDesc"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.1}" headerText="Status" dataField="statusDesc"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.1}" headerText="Country" dataField="countryName"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.21}" headerText="Contact Name" dataField="contactName"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.12}" headerText="Mobile" dataField="contactMobile"/>

      <mx:DataGridColumn width="{dgSerachResult.width*0.12}" headerText="Telephone" dataField="contactTel"/>

      </mx:columns>

      </mx:DataGrid>

       

      Thanks In Advance For Helping Guys!