Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF Statements for ItemTemplates?

Status
Not open for further replies.

tqeonline

MIS
Oct 5, 2009
304
US
Hey Guys!

So I have a question. Hopefully it results in an easy answer.

I have a datasource (sqadatasource1) that is used to create a gantt chart. It creates the different labels by evaluating the start and end times.

Well this database sends a field ("environment") and I want the labels to be colored by that field.

Code:
ex. IF Environment = QA02 then forecolor = #4F81BD

Something like that. I have a dropdownlist being bound to a Distinct list of Environments, I don't foresee that list growing. But I want to program the colors to just assign a color to it so I don't have to keep updating the website.

Then I'd like for the page to create a legend at the bottom that says X color = QA02

This is what the item template currently has:
Code:
<ItemTemplate>
     <asp:Label runat="server" ID="lblDefect" Text='<%# Eval("Application") +" "+ Eval("Duration")%>' ToolTip='<%# "Defect ID#" & Eval("Defect") & " - " & Eval("DetectedInCycle")%>'>
     </asp:Label>
</ItemTemplate>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top