Created
December 7, 2016 04:41
-
-
Save smarenich/f8030185e715eefda3fb2cea6aeb8f96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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