TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
raven daniel
1.6k
123
42.4k
Change the forecolor of an item in a repeater based on the status?
Nov 29 2011 2:36 AM
public string CompanyStatus(int iStatus)
{
string strCompanyStatus = string.Empty;
if (iStatus == 2 || iStatus == 3)
{
//foreach (RepeaterItem ri in rptCompanies.Items)
//{
// if (((Label)ri.FindControl("RowStatus")).Value == '2')
// foreach (Control ctl in rptCompanies.Controls[iStatus].Controls)
// {
// if (!ctl.GetType().Equals(typeof(Label)))
// continue;
// ((Label)ctl).ForeColor = System.Drawing.Color.Red;
// }
//}
return "style='backGround-color:red'";
}
return strCompanyStatus = iStatus == 1 ? "Active" : "InActive";
}
#endregion
<ItemTemplate>
<tr>
<td>
<%# CompanyStatus((Int32)DataBinder.Eval(Container.DataItem, ("RowStatus")))%>
</td>
</tr>
</ItemTemplate>
This is basicaly what im looking for. if the status is 2 or 3, The forecolor of that item for the repeater must appear in red, and yes im newish :) . Using Visual 2010, C#, asp.net. Windows 7.?
Reply
Answers (
1
)
C sharp Studying
Record changes in the variables