How can I conditionally put an image into a cell on my ASPxGridView. For example; if Column1 is above 1000 I would like to see ‘above.png’ on Column2, if below 1000 i want to see ‘below.png’ on Column2.
Here is the markup for my ASPXGridView:
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="pkCalisan" Width="100%" >
<Columns>
<dx:GridViewDataTextColumn
FieldName="ID"
ReadOnly="True"
VisibleIndex="0">
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="Price" VisibleIndex="1"></dx:GridViewDataTextColumn>
<dx:GridViewDataImageColumn VisibleIndex="2"></dx:GridViewDataImageColumn>
</Columns>
</dx:ASPxGridView>
Thanks..
Define a custom image control inside the column’s DataItemTemplate and manage the image’s properties (visibility or image URL) at runtime.
See the E2270 Example that illustrates how to manage the hyperlink’s properties in a similar scenario.