Jaq*_*arh 5 php c# linq asp.net entity-framework
我正在研究一个使用Entity Framework的小项目,我目前正在学习ASPxGridView,但是,我似乎无法在互联网上找到任何与向列添加规则相关的内容,然后根据列显示图标或突出显示行.规则集.
像这样:https://demos.devexpress.com/ASPxGridViewDemos/Rows/ConditionalFormatting.aspx
如果有人可以发给我任何他们可以找到的参考资料,这可能有助于我指出正确的方向,我们将不胜感激.
谢谢.
前端添加实体框架 ASPxGridView 模型:
OnHtmlDataCellPrepared="ASPxGridView1_HtmlDataCellPrepared"
Run Code Online (Sandbox Code Playgroud)
后端添加:
// Add this in the Namespace area, not inside the Page_Load function
public bool ProcessSelectionChangedOnServer { get; set; }
protected void ASPxGridView1_HtmlDataCellPrepared(object sender,
DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
{
// if statements go here
e.Cell.BackColor = System.Drawing.Color.LightCyan;
}
Run Code Online (Sandbox Code Playgroud)
代码结果:
所有单元格背景颜色更改为LightCyan
参考:
ASPxGridView.HtmlRowPrepared 事件
TreeListSettingsBehavior.ProcessSelectionChangedOnServer 属性