Telerik 网格行颜色
根据 Telerik 网格上的数据更改行的背景颜色的唯一方法是在 ItemDataBound 事件中执行此操作吗?我有一个包含大量数据的网格,并且需要很长时间。我在数据行中有一个属性,它告诉我该行需要什么颜色。我希望能够在运行时动态设置 css 类。
谢谢,
朗达
Is the only way to change the background color of a row based on data on the Telerik grid by doing it in the ItemDataBound event? I have a grid that a huge amount of data and it is taking a really long time. I have a property in the data row that tells me what color the row needs to be. I would like to be able to dynamically set the css class at runtime.
Thanks,
Rhonda
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您希望在 OnItemDataBound 事件期间专门更改行的样式,我建议您查看 此文档文章来自 Telerik 在线文档。它介绍了如何从代码隐藏设置内联样式,或使用预定义的 CSS 样式并将它们应用到行。
If you are looking to specifically change the style of the row during the OnItemDataBound event I recommend that you look at this documentation article from the Telerik online documentation. It covers how you can set inline styles from the code-behind, or use predefined CSS styles and apply them to the rows.
您应该能够使用
ItemStyle
和AlternatingItemStyle
更改行颜色:You should be able to change the row color using
ItemStyle
andAlternatingItemStyle
: