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

  • Home
  • SEARCH
  • 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 6669921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:12:28+00:00 2026-05-26T03:12:28+00:00

recently while working on the dropdownlist, i came accross a strange issue, i am

  • 0

recently while working on the dropdownlist, i came accross a strange issue, i am binding a datatable to dropdownlist, now my datatable contains 3 columns, (Name,Id,Count), in DataTextField i want to concatenate Name and count like below.

DropDownlist.DataTextField = "Name (Count)";

but i am unable to do above thing, is there any other way i can achieve the above aim, i know the work around, using loop and concatenating in the

DropDownlist.Items.Add();

but i want to know whether i can do using DataTextField.

  • 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-26T03:12:28+00:00Added an answer on May 26, 2026 at 3:12 am

    You can if you can create a custom data field in your data source and do the concatenation in there. For instance, something like so (you may have to some casting or converting, but hopefully you get the idea):

    SELECT
    Name,
    Count,
    Id,
    Name + ' (' + Count + ')' AS DataField
    FROM
    TABLE
    

    Then set

    DropDownlist.DataTextField = "DataField";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with MVC recently and I've encountered a strange problem while trying to
I have been working with python for a while now. Recently I got into
While working on a script recently, I came across a peculiar nuance of how
While working in a Java app, I recently needed to assemble a comma-delimited list
Recently, while working on a shared host, I accidentally changed the permissions of my
I've been using TortoiseSVN for a while and recently came back to recommitting all
I recently noticed this while working on an app- why is it that when
While working with reflection, I recently got to the point where I wanted to
I've been working with Django for a while now (currently on version 1.2), but
I was working on some code recently and came across a method that had

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.