Mike Eghtebas
asked on
Gridview and conditional formatting...
A girdview populated via a stored procedure has two columns.
CustomerName and PastDueYN
Question: How can I make CustomerName field shaded light blue for customers with PastDue = True (similar to the conditional formatting in MS Access).
Alos, is there a way to keep PastDueYN invisible?
Thank you,
CustomerName and PastDueYN
Question: How can I make CustomerName field shaded light blue for customers with PastDue = True (similar to the conditional formatting in MS Access).
Alos, is there a way to keep PastDueYN invisible?
Thank you,
ASKER
Hi Carl,
Thank you your post. I located:
stackoverflow.com/question s/16799166 /formattin g-programm atically-c hanging-th e-row-colo r-of-a-gri dview-cont rol
But it is in C#, I will try to get my control's name and attempt to apply to my project:
I will run by the code I come up with.
Mike
Thank you your post. I located:
stackoverflow.com/question
But it is in C#, I will try to get my control's name and attempt to apply to my project:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
//in every row I would like to check the text of the second cell
if (GridView1.Rows[i].Cells[1].Text == "C6N")
{
e.Row.BackColor = System.Drawing.Color.Red;
}
}
}
I will run by the code I come up with.
Mike
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should be able to hide the column easily enough. How are you currently defining the columns for your GridView? Are you letting them be auto-generated?