I am trying to access the value of a DataGridColumn and change the
DataField for another column based on this value...
Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml";
              creationComplete="getDp()" >

... Datagrid>
        <mx:columns>
             <mx:DataGridColumn dataField="Ticker"
                  headerText="Ticker"/>
             <mx:DataGridColumn id="Kind"
                 dataField="Kind"
itemRenderer="com.steury.baseClasses.CellFieldTrd" />
             <mx:DataGridColumn id="Profit"
                 headerText="Profit"/>

ActionScript:

private function getDp():void  {
if(Application.application.CnvPos.dgOrdExt.selectedItem.Kind=="LONG")Pro\
fit.dataField="Profit";Application.application.CnvPos.dgOrdExt.refresh()\
;
}


//This code works find if I use

if(Kind.DataField="Kind")Profit.dataField="Profit";

//above to test the rest of the code.

I can not figure out how to access the value of the Datagridcolumn.  I
have tied using event listeners, etc.. which did not work.  Please let
me know if anyone can help this fairly simple dilemma.





Reply via email to