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 5979341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:38:44+00:00 2026-05-22T21:38:44+00:00

I am using repeater to bind all table data. And My table fields are

  • 0

I am using repeater to bind all table data.

And My table fields are Name,Option1,Option2… Option12. All total 13 columns.
values for Option columns are dynamic. some time it contains two values for Option1 and 2 and some times figure can be change between 1 to 12.

Now i want to show only those option columns that contain some value.

Like this:-

Name
Option1
Option2
Option8

Name
Option10
Option12
Option4
Otion3

Name
Option5
Option7

Name
Option3
Option2
Option5
Option12
Option4

Means options are not fixed. how can i manage this with Repeater control.
SO it can show value like this. Please suggest me the correct way to solve this.

Thanks in Advance.

First Edit

<%# !Equals(DataBinder.Eval(Container.DataItem, "Option1")%>
....
<%# !Equals(DataBinder.Eval(Container.DataItem, "Option12")%>

Suppose i have this 12 Options like this.
Now if my data source contains values only Option 1 to 5 then i need that rest of 6 to 12 options will not show on repeater.

  • 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-05-22T21:38:45+00:00Added an answer on May 22, 2026 at 9:38 pm

    Try this it’s helpful for you,

    ID

    Name

    Orders

      <ItemTemplate>
            <tr style="background-color:FFECD8">
               <td valign="top">
                  <%# DataBinder.Eval(Container.DataItem, "ID") %>
               </td>
               <td valign="top">
                  <%# DataBinder.Eval(Container.DataItem,"Name") %>
               </td>
               <td>
                 <asp:Repeater Runat="server" ID="ordersRepeater" EnableViewState="false"
                    DataSource='<%# DataBinder.Eval(Container.DataItem, "Orders") %>'>
                    <ItemTemplate>
                        <%# DataBinder.Eval(Container.DataItem, "OrderID") %> - <%# DataBinder.Eval(Container.DataItem, "OrderName") %> - <%# DataBinder.Eval(Container.DataItem, "OrderCost")%>
                        <br />
                    </ItemTemplate>
                </asp:Repeater>
               </td>
            </tr>
      </ItemTemplate>
    
    
      <FooterTemplate>
         </Table>
      </FooterTemplate>
    

    The code behind is as follows:

    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    using System.Text;
    using System.Xml;
    using System.Xml.Schema;

    public class Customer
    {
    private int id;
    public int ID
    {
    get { return this.id; }
    set { this.id = value; }
    }

    private string name;
    public string Name
    {
        get { return this.name; }
        set { this.name = value; }
    }
    
    public List orders;
    public List Orders
    {
        get { return this.orders; }
        set { this.orders = value; }
    }
    

    }

    public class Order
    {
    private int orderID;
    public int OrderID
    {
    get { return this.orderID; }
    set { this.orderID = value; }
    }
    private string orderName;
    public string OrderName
    {
    get { return this.orderName; }
    set { this.orderName = value; }
    }
    private decimal orderCost;
    public decimal OrderCost
    {
    get { return this.orderCost; }
    set { this.orderCost = value; }
    }
    }

    public partial class _Default : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    List orders1 = new List();
    Order order1 = new Order();
    order1.OrderID = 1;
    order1.OrderName = “Pepsi”;
    order1.OrderCost = 12.5M;
    orders1.Add(order1);

        Order order2 = new Order();
        order2.OrderID = 2;
        order2.OrderName = "7up";
        order2.OrderCost = 12M;
        orders1.Add(order2);
    
        List orders2 = new List();
        Order order3 = new Order();
        order3.OrderID = 4;
        order3.OrderName = "Food";
        order3.OrderCost = 12.5M;
        orders2.Add(order3);
    
        List customers = new List();
        Customer c1 = new Customer();
        c1.ID = 1;
        c1.Name = "Bilal";
        c1.Orders = orders1;
        customers.Add(c1);
    
        Customer c2 = new Customer();
        c2.ID = 2;
        c2.Name = "potterosa";
        c2.Orders = orders2;
        customers.Add(c2);
    
    
        this.Repeater1.DataSource = customers;
        this.Repeater1.DataBind();
    }
    
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    
    }
    

    }

    Go through following link

    http://forums.asp.net/t/1118175.aspx/1

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

Sidebar

Related Questions

I'm using the Repeater control on my site to display data from the database.
Existing code is using an asp:repeater to build an HTML table. (emphasis on the
A table row is generated using an asp:Repeater: <asp:repeater ID=announcementsRepeater OnItemDataBound=announcementsRepeater_ItemDataBound runat=Server> <itemtemplate> <tr
HI, I'm having a Repeater bound to a ObjectDataSource. I retrieve my data using
I had Repeater which bind method this method retrieve data from data base by
It's easy to bind a data source to something like a gridview or repeater,
I am trying to place a repeater within a repeater using xml data. I
I'm using a repeater control and I'm trying to pass a parameter as such:
I'm working on an ASP.NET website where I am using an asp:repeater with paging
Right now I am using this to export a repeater (with multiple nested repeaters)

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.