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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:37:14+00:00 2026-05-16T16:37:14+00:00

I am working on a Repeater that reads from a table with a layout

  • 0

I am working on a Repeater that reads from a table with a layout something like:

string Title
string Location
bool Water
bool Sewer
bool Picnic_Table
bool On_Beach
...

I am creating a list of amenities for each “Title” so I need to loop through the columns and get a list of amenities for each Title (or site). Optimally, I have a loop to go through the list. Something like

for each column
   if column is not Title or Location
      Append to StringBuilder "column name"

How do I get that column name to do the comparisons?

  • 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-16T16:37:15+00:00Added an answer on May 16, 2026 at 4:37 pm

    Here’s how to get the column name in the OnItemCreated event of the Repeater control:

    protected void rptOnItemCreated_OnItemCreated(object sender, RepeaterItemEventArgs e)
    {
        string columnName = string.Empty;
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            DataRowView drv = (DataRowView)e.Item.DataItem;
            DataRow dr = drv.Row;
            foreach (DataColumn dc in dr.Table.Columns)
            {
                // Do what you want with the column name
                columnName = dc.ColumnName;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on highlighting a repeater row when i click anywhere on that row.
I have created a page that loads data from a query string. And creates
This is a followup from Populating DropDownList inside Repeater not working . I'm adding
I currently have a table with a repeater that is being filled with data
I am working with JSF/ICEFaces and I need to generate a table from a
I am working on a perforce-perl script that creates labels. Due to repeated execution
You know if you're working with Repeater Controls you're not able to access the
Is there a way with ASP.NET to tell a data repeater which is working
Working with an undisclosed API, I found a function that can set the number
I'm working in a Repeater over blog posts and I'm displaying a ShareThis JavaScript

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.