skearney
(Shannon Kearney)
April 9, 2019, 9:38pm
1
I have this dynamic query which runs after a button click.
DynamicQueryAdapter dqaATT = new DynamicQueryAdapter(oTrans);
dqaATT.BOConnect();
QueryExecutionDataSet qedsATT = dqaATT.GetQueryExecutionParametersByID("GS_Customer_Attributes_Search");
qedsATT.ExecutionParameter.Clear();
qedsATT.ExecutionParameter.AddExecutionParameterRow("Attribute", BAQComboAttributeDropdown.Text , "nvarchar", false, Guid.NewGuid(), "ATT");
dqaATT.ExecuteByID("GS_Customer_Attributes_Search", qedsATT);
gridAttributesSales.DataSource = dqaATT.QueryResults.Tables["Results"];
I want the row to be red if the column [“Calculated_TotalTouches”] = 0
I’ve used something like this before to format a column but I’m unsure of how to get my request above coded: //gridAttributesSales.DisplayLayout.Bands [0].Columns[“OrderDtl_GS_LineTotalPrice_c”].Format = “###,##0 .00”;
josecgomez
(Jose C Gomez)
April 9, 2019, 10:53pm
2
Look at the initialize row event off the ultra grid
1 Like
private void InitializeRow(object sender , InitializeRowEventArgs e)
{
//logic to determine if this row qualifies here....
e.Row.Appearance.BackColor = NewColor;
}
You should create a customization for your dashboard assembly and use the row rules wizard. It will automatically add the code you need following Epicor’s best practices.
3 Likes
skearney
(Shannon Kearney)
April 10, 2019, 5:55pm
5
Okay so how do I write the part for determining if this row qualifies?
josecgomez
(Jose C Gomez)
April 10, 2019, 6:02pm
6
“e” refers to the current row so you’ll want to get the Cell which holds your value in that row and check it against your condition.
skearney
(Shannon Kearney)
April 10, 2019, 6:34pm
7
private void gridAttributesSales_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs args)
{
if (["Calculated_TotalTouches"].SalesAttributes.Row.Value == 0)
{
SalesAttributes.Row.Appearance.BackColor = Color.Red;
}
}
skearney
(Shannon Kearney)
April 10, 2019, 6:34pm
8
I have this so far but it isn’t compiling
litzer67
(Scott Litzau)
April 10, 2019, 6:49pm
10
If(args.Row.Cells[“Calculated_TotalTouches”].Value = 0)
skearney
(Shannon Kearney)
April 10, 2019, 6:54pm
11
private void gridAttributesSales_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs args)
{
SalesAttributes = (EpiUltraGrid)csm.GetNativeControlReference("734456b7-1448-419b-87f8-f2c950d63cc2");
if (args.Row.Cells["Calculated_TotalTouches"].Value.ToString() == "0")
{
SalesAttributes.Row.Appearance.BackColor = Color.Red;
}
}
Okay that line compiles but now I have an issue with the last line…
skearney
(Shannon Kearney)
April 10, 2019, 7:06pm
12
I got it, duh!
private void gridAttributesSales_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs args)
{
SalesAttributes = (EpiUltraGrid)csm.GetNativeControlReference("734456b7-1448-419b-87f8-f2c950d63cc2");
if (args.Row.Cells["Calculated_TotalTouches"].Value.ToString() == "0")
{
args.Row.Appearance.BackColor = Color.Red;
}
}
litzer67
(Scott Litzau)
April 10, 2019, 7:07pm
13
args.Row.Appearance.BackColor = Color.Red;
Beat me to it.
1 Like
skearney
(Shannon Kearney)
May 9, 2019, 7:46pm
15
I am trying to use this same code in an Epicor Form Invoice Entry. The exact same code will not compile.
That just seems like you are missing using statement for System.Drawing