i need datagridview using findcontrol coloring

Posted by Jayakumars under Regular Expressions on 6/21/2011 | Points: 10 | Views : 3038 | Status : [Member] [MVP] | Replies : 1
I am design Gridview control check my image below.May be 100 rows have but now
my issue
1.Every Control i am using find control like this

foreach (GridViewRow gr in Dtg_EmpAttDet.Rows)
TextBox TD1 = ((TextBox)gr1500.Cells[0].FindControl("TtD1"));
TextBox TD2 = ((TextBox)gr1500.Cells[0].FindControl("TtD2"));

2.below if statement which textbox !="AA" value i need coloring
so i am using if statement like this
below statement i am using or,and both using but i
if (TD1.Text != "AA" || TD2.Text!="AA")
TD1.BackColor = System.Drawing.Color.Brown;
TD2.BackColor = System.Drawing.Color.Brown;

but my output 2 row notworking correctly because every row match and calidate here how to solve this.
Click and 3 header working good i need same function header 2 but i am achieve
this but every control i am write if statements but this is wrong how to simplify this.

Mark as Answer if its helpful to you



Posted by: Naimishforu on: 6/21/2011 [Member] [MVP] Bronze | Points: 25

Can you please explain it properly? I am not able to get exactly what you are looking for!

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response