0

I am using the ComponentArt Grid control to display some text which works fine, an example line is shown below.

<ComponentArt:GridColumn width="70"  DataField="ActiveState" HeadingText="Active State" />

I am databinding so that the above line displays “Enabled” or “Disabled”, as “ActiveState” is a property on a class that returns the appropriate string. I’ve now been asked to replace the text with a graphic (a tick or a cross). I’m not too familiar with this control and find the ComponentArt website rather unhelpful. Can anyone suggest the appropriate format to display a graphic in the cell rather than text?

Retrocoder
  • 4,483
  • 11
  • 46
  • 72

1 Answers1

0

I found this on the ComponentArt example site:

<Columns>
          <ComponentArt:GridColumn DataField="PriorityIcon" Align="Center" DataCellClientTemplateId="PriorityIconTemplate" HeadingCellCssClass="FirstHeadingCell" DataCellCssClass="FirstDataCell" HeadingImageUrl="icon_priority.gif" HeadingImageWidth="9" HeadingImageHeight="14" AllowGrouping="false" SortedDataCellCssClass="SortedDataCell" Width="12" FixedWidth="True" />

Then add a template like this:

<ClientTemplates>
      <ComponentArt:ClientTemplate Id="PriorityIconTemplate">
        <img src="images/## DataItem.GetMember('PriorityIcon').Value ##" width="8" height="10" border="0" >
      </ComponentArt:ClientTemplate>

For reference, here is the url, just click on view code: Component art

fARcRY
  • 2,338
  • 6
  • 24
  • 40