Skip to content

Instantly share code, notes, and snippets.

@smarenich
Created December 7, 2016 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarenich/f8030185e715eefda3fb2cea6aeb8f96 to your computer and use it in GitHub Desktop.
Save smarenich/f8030185e715eefda3fb2cea6aeb8f96 to your computer and use it in GitHub Desktop.
<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