gpt4 book ai didi

c# - 实体/LINQ/ASP.NET : ASPxGridView Adding Rules

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:37:56 24 4
gpt4 key购买 nike

我正在开发一个使用 Entity Framework 的小项目,我目前正在学习 ASPxGridView,但是,我似乎无法在 Internet 上找到任何与向列添加规则相关的内容,然后显示一个图标或突出显示该行取决于规则集。

是这样的:https://demos.devexpress.com/ASPxGridViewDemos/Rows/ConditionalFormatting.aspx

如果有人可以将他们找到的任何引用资料发给我,以帮助我指明正确的方向,我们将不胜感激。

谢谢。

最佳答案

在 Entity Framework ASPxGridView 模型上添加的前端:

OnHtmlDataCellPrepared="ASPxGridView1_HtmlDataCellPrepared"

后端添加:

// 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;
}

代码结果:

所有 Cell 背景颜色更改为 LightCyan

引用资料:

ASPxGridView.HtmlRowPrepared Event
TreeListSettingsBehavior.ProcessSelectionChangedOnServer Property

关于c# - 实体/LINQ/ASP.NET : ASPxGridView Adding Rules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35360631/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com