2010-11-26 68 views
0

我正在使用ComponentArt網格控件來顯示可以正常工作的一些文本,下面顯示了一個示例行。將圖形添加到ComponentArt網格控件單元中

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

我數據綁定使得上述行顯示「啓用」或「禁用」,爲「ActiveState的」是基於返回的適當的字符串一類的屬性。我現在被要求用圖形(勾號或十字)替換文本。我對這個控件不太熟悉,並且發現ComponentArt網站毫無幫助。任何人都可以提出適當的格式來顯示單元格中的圖形而不是文本?

回答

0

我發現這對ComponentArt示例站點:

<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" /> 

然後添加一個模板,像這樣:

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

僅供參考,這裏是網址,只需點擊查看代碼: Component art

相關問題