Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:04:39+00:00 2026-06-11T15:04:39+00:00

I am populating a Listview control from my codebehind. Does anyone know of a

  • 0

I am populating a Listview control from my codebehind.

Does anyone know of a way i can assign a css style to a table cell, is say the lowest price is greater than the amazon price?

 <asp:ListView ID="lv1" runat="server" ItemPlaceholderID="itemPlaceholder" OnPagePropertiesChanging="ChangePage">
    <LayoutTemplate>
        <table id="dataTable">
            <thead>
            <tr>
                <th class="t-left">Product Title</th>
                <th>SKU</th>
                <th>Our Price</th>
                <th>Amazon Price</th>
                <th>Lowest Price</th>
                <th>Actions</th>
            </tr>
            </thead>
            <tbody  id="dataResults" >
            <tr id="itemPlaceholder" runat="server"></tr>
        </tbody>
        </table>
    </LayoutTemplate>
    <ItemTemplate>
      <tr id='<%#Eval("sku") %>'>
       <td class="t-left" width="360px">
           <asp:HyperLink ID="prodLnk" runat="server" NavigateUrl='<%#"~/product/editproduct.aspx?sku=" + Eval("sku") %>' ToolTip="Edit this product listing">
                <asp:Label runat="server" ID="lblTitle"><%#Eval("title") %></asp:Label>
           </asp:HyperLink>
       </td>
       <td><asp:Label runat="server" ID="lblSku"><%#Eval("sku") %></asp:Label></td>
       <td><asp:Label runat="server" ID="lblTWE">£<%#Eval("twePrice") %></asp:Label></td>
       <td class="amzprice-edit"><input type="text" id='<%#"txt" + Eval("sku") %>' value='<%#Eval("amzPrice") %>'> </td></td>
       <td>
           <asp:Label runat="server" ID="lblLow">£<%#Eval("lowprice")%></asp:Label>
           <a href='<%#"lowpricedata.aspx?sku=" + Eval("sku") %>' id="lnkInfoGrpah" class="link-to info-graph" data-fancybox-type="iframe"><img src="images/icons/graph-icon.png" alt="Info" title="View Lowprice History" /></a>
       </td>

       <td><div class="twe-button mini update">Update</div></td>
      </tr>
    </ItemTemplate>
</asp:ListView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:04:40+00:00Added an answer on June 11, 2026 at 3:04 pm

    The simplest way to do this is to add an additional property to your object/data source and then use that in the databinding stage.

    For example, create a boolean property called LowestPrice

    You can then evaluate this when databinding:

    class='<%# Eval("LowestPrice") == true ? "BuyMeNow" : "BuyMeLater" %>'
    

    Your example above would become something like:

    <ItemTemplate>
      <tr id='<%#Eval("sku") %>' class='<%# Eval("LowestPrice") == true ? "BuyMeNow" : "BuyMeLater" %>'>
       <td class="t-left" width="360px">
           <asp:HyperLink ID="prodLnk" runat="server" NavigateUrl='<%#"~/product/editproduct.aspx?sku=" + Eval("sku") %>' ToolTip="Edit this product listing">
                <asp:Label runat="server" ID="lblTitle"><%#Eval("title") %></asp:Label>
           </asp:HyperLink>
       </td>
       <td><asp:Label runat="server" ID="lblSku"><%#Eval("sku") %></asp:Label></td>
       <td><asp:Label runat="server" ID="lblTWE">£<%#Eval("twePrice") %></asp:Label></td>
       <td class="amzprice-edit"><input type="text" id='<%#"txt" + Eval("sku") %>' value='<%#Eval("amzPrice") %>'> </td></td>
       <td>
           <asp:Label runat="server" ID="lblLow">£<%#Eval("lowprice")%></asp:Label>
           <a href='<%#"lowpricedata.aspx?sku=" + Eval("sku") %>' id="lnkInfoGrpah" class="link-to info-graph" data-fancybox-type="iframe"><img src="images/icons/graph-icon.png" alt="Info" title="View Lowprice History" /></a>
       </td>
    
       <td><div class="twe-button mini update">Update</div></td>
      </tr>
    </ItemTemplate>
    

    Which would apply the class BuyMeNow to the row when LowestPrice is true.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm populating a ListView with items and add images from an ImageList (in the
I have a ListView that I am populating with items from an ObservableCollection .
Im populating viewdata with a bunch of css style properties. <span style=font-size:50pt; font-family:<%= ViewData[font]%>;><%=
I am populating the ListView from my Custom DataAdaptor. I have a layout defined
This is a populating a listview on a fragment from a database: public View
I am populating a listview from a database but in certain cases I want
I am needing help populating data from a database into a custom ListView. I
I have a ListView that I'm populating from a custom ListAdapter . Inside the
So I've got a ListView (using a ListActivity ) that I'm populating from a
Following the Android sample for populating a ListView , I query an array from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.