Chris
Chris

Reputation: 863

Add Images to Flex Datagrid

I have a Datagrid that already gets its data from a data provider, there is a column in the grid called priority. What i want to do is if the column priority contains the value high then in an empty column in the datagrid i want to insert and image , the image being inserted depending on the value of the column priority.

Any help would be much appreciated.

thanks Chris

Upvotes: 1

Views: 2915

Answers (1)

Jason Towne
Jason Towne

Reputation: 8050

You could do this using an itemRenderer. Check out this link for an example. Here's another quick example:

<mx:DataGridColumn width="30" editable="false">
  <mx:itemRenderer>
    <fx:Component>
      <mx:Canvas horizontalScrollPolicy="off">
        <mx:Image id="myImage" x="11" source="{outerDocument.MyPriorityImage}" visible="{data.Priority > 50}" includeInLayout="{data.Priority > 50}"/>
      </mx:Canvas>
    </fx:Component>
  </mx:itemRenderer>
</mx:DataGridColumn>

Upvotes: 2

Related Questions