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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:19:20+00:00 2026-06-05T23:19:20+00:00

I have a data bound listbox that lists names of items, I am now

  • 0

I have a data bound listbox that lists names of items, I am now wanting to display both the item number and the Item name in something that looks like: i-001 – Item 1. I have done something similar to this, but it was when I was not using data text fields, but iDataReaders instead.

so can I append the datatextfield attribute in anyway to accept more than one column? Either in the aspx page or in the code behind?

If there is any code that can be of help I can provide it to you, if there is any clearing up that can be done I will do my best to do so.

Thank you

Sample Code:

listItems.DataSource = DAL.Util.getItemProfiles(vendor,catalog);
listItems.DataBind();


public string ItemNumName
{
    get { return "CustItemNum" + " - " + "Name"; }
}

protected void listItems_DataBound(object sender, EventArgs e)
{
    listItems.DataTextField = ItemNumName;
}

this cause the following error message:

DataBinding: ‘System.Data.DataRowView’ does not contain a property with the name ‘CustItemNum – Name’.

If I remove the + ” – ” + “Name” from the property it functions correctly by showing just the CustItemNum field

  • 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-05T23:19:22+00:00Added an answer on June 5, 2026 at 11:19 pm

    you could also edit your sql to concatenate the two columns and then use that as your datatextfield. Using provided variable names it would look something like:

    Select CustItemNum, Name,  CustItemNum + ' - ' + Name AS NumberName
    

    then you should be able to use NumberName as the DataTextField and it should display like “itemNumber – itemName”

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

Sidebar

Related Questions

I have a ListBox that is being bound to data from a WCF service.
I have a data bound Listbox as shown below. I want the textblock that
Here's the problem: I have a data-bound list of items, basically a way for
I use ADO.NET Entity-Framework, I have a page that is data-bound to an entity
I have a listbox with values. Now I need to sort that listbox, BUT
Say I have a ListBox that is bound to an observable collection on my
I have a listbox that is bound to a List<T> -- this is working
I have a UserControl that contains a ListBox that is bound to a CollectionViewSource
I have a ListBox data bound to the collection of my PersonCollection class. Next,
I have a data-bound ListBox with an ItemTemplate which i want to enable keyboard

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.