Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
i have problem to add css to behine control code
this is my code

C#
grdSAS.Rows[e.Row.RowIndex - 1].Attributes.Add("style", "Background-color:#ccc");
Posted
Comments
[no name] 23-May-15 7:45am    
Write like this..

e.Row.CssClass = "alternate";

css class

.grid-view tr.alternate
{
color: black;
background-color: #D59200;
height: 25px;
vertical-align: middle;
text-align: center;
}

This one you can try,
grdSAS.Rows[e.Row.RowIndex - 1].Attributes.Add("style", "Background-color:#ccc";);
 
Share this answer
 
thanks about help me bout i use
C#
e.Row.CssClass = "alternate";

in code dehinde and use
CSS
.grid-view tr.alternate
{
color: black;
background-color: #D59200;
height: 25px;
vertical-align: middle;
text-align: center;
}

in css file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900