title: How to highlight the row in listview according to condition?
body: <p>I want to change background color of the row in particular condition.My code is </p>
  
  <pre><code>&lt;asp:ListView ID="lst_SentItems" runat="server" ItemPlaceholderID="tr" OnItemDataBound="lst_SentItems_ItemDataBound"&gt;
                                  &lt;LayoutTemplate&gt;
                                      &lt;table cellspacing="0"&gt;
                                          &lt;tr class="hdrRowColor1"&gt;
                                              &lt;td align="left" width="180px"&gt;
                                                  EmpName
                                              &lt;/td&gt;
                                              &lt;td align="left" width="180px"&gt;
                                                  Salary
                                              &lt;/td&gt;
                                              &lt;td align="left" width="180px"&gt;
                                                  Address
                                              &lt;/td&gt;
                                              &lt;td align="left" width="180px"&gt;
                                                  Department
                                              &lt;/td&gt;
                                            &lt;/tr&gt;
                                          &lt;tr id="tr" runat="server"&gt;
                                          &lt;/tr&gt;
                                      &lt;/table&gt;
                                  &lt;/LayoutTemplate&gt;
                                  &lt;ItemTemplate&gt;
                                      &lt;tr class='&lt;%# Convert.ToBoolean(Container.DataItemIndex % 2) ? "EvenRowColor" : "OddRowColor" %&gt;'&gt;
                                              &lt;td align="left"&gt;
                                                  &lt;asp:label id="lbl3" runat="server" text='&lt;%# Eval("EmpName")%&gt;' /&gt;
  
                                              &lt;/td&gt;
                                              &lt;td align="left"&gt;
  </code></pre>
  
  <p>' /></p>
  
  <pre><code>                                            &lt;/td&gt;
                                              &lt;td align="left"&gt;
                                                 &lt;asp:label id="lbl1" runat="server" text='&lt;%# Eval("Address")%&gt;' /&gt;
  
                                              &lt;/td&gt;
                                              &lt;td align="left"&gt;
                                                 &lt;asp:label id="lbl" runat="server" text='&lt;%# Eval("Department")%&gt;' /&gt; 
                                              &lt;/td&gt;
  
                                      &lt;/tr&gt;
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>Now i want to give color to particular department like if person is from Account dept then the row's background color should be red, if person belongs to IT dept then Back ground color should be green. 
  I have tried it some code in ItemdataBound but that code changes only the back ground of labels.i want to change the row back ground.That code is </p>
  
  <pre><code> protected void lst_SentItems_ItemDataBound(object sender, ListViewItemEventArgs e)
  {
      if (e.Item.ItemType == ListViewItemType.DataItem)
      {
          Label lblCount = (Label)e.Item.FindControl("lbl");
          if (lblCount != null)
          {
              if (lblCount.Text == IT2")
              {
                             lblCount.BackColor = System.Drawing.Color.Red;
              }
          }
      }
  }
  </code></pre>