将图形添加到 ComponentArt Grid 控件单元格

发布于 2024-10-04 03:49:48 字数 333 浏览 0 评论 0原文

我正在使用 ComponentArt Grid 控件来显示一些运行良好的文本,示例行如下所示。

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

我进行数据绑定,以便上面的行显示“Enabled”或“Disabled”,因为“ActiveState”是返回适当字符串的类的属性。现在我被要求用图形(勾号或十字)替换文本。我对这个控件不太熟悉,并且发现 ComponentArt 网站毫无帮助。谁能建议在单元格中显示图形而不是文本的适当格式?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

匿名。 2024-10-11 03:49:48

我在 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>

作为参考,这里是 url,只需点击查看代码:
组件艺术

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文