Skip navigation.
Home

Adding an image to a CFGRID

The trick is to bind a column in the grid to a CfFormItem.

<cfform name="myform" format="Flash" height="450" width="600" >

<cfgrid name= "grid" query="properties" height="200">

<cfgridcolumn name="city" header="City">

<cfgridcolumn name="photo" header="Photo">

</cfgrid>

<!--- show the picture in an html cfforitem

paragraph is added because Firefox sometimes fail to load the picture --->

<cfformitem type="html" height="200" width="300"

bind="{'<p><img src=\'images/'+grid.selectedItem.photo+ '\'></p>'}"></cfformitem>

</cfform>