Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<px:PXGrid ID="grid" runat="server" Height="350px" Width="100%" AdjustPageSize="Auto"
SkinID="Primary" AllowPaging="True" AllowSearch="True" FastFilterFields="AccountCD,Description" SyncPosition="True"
OnRowDataBound="grid_RowDataBound">
<Levels>
<px:PXGridLevel DataMember="AccountRecords">
<Columns>
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>
using System;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Page_GL202500 : PX.Web.UI.PXPage
{
protected void Page_Load(object sender, EventArgs e)
{
RegisterStyle("MyCssRed", "Red", null, false);
}
private void RegisterStyle(string name, string backColor, string foreColor, bool bold)
{
Style style = new Style();
if (!string.IsNullOrEmpty(backColor)) style.BackColor = Color.FromName(backColor);
if (!string.IsNullOrEmpty(foreColor)) style.ForeColor = Color.FromName(foreColor);
style.Font.Bold = bold;
this.Page.Header.StyleSheet.CreateStyleRule(style, this, "." + name);
}
protected void grid_RowDataBound(object sender, PX.Web.UI.PXGridRowEventArgs e)
{
Object value = e.Row.Cells["Active"].Value;
if (value != null && ((Boolean)value) == false)
e.Row.Style.CssClass = "MyCssRed";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.