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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:45:35+00:00 2026-06-10T09:45:35+00:00

This is my list definition public class EventsList { public int EventID { get;

  • 0

This is my list definition

public class EventsList
    {
        public int EventID { get; set; }
        public string EventName { get; set; }
    }

This is C# code

string strCurrentUser = CommonWeb.GetLoginUser();
       EventsClass EventObj = new EventsClass();
       DataSet ds;
       List< EventsList> eventList = new List<EventsList>();
       EventsList eventobj = new EventsList();
       ds=EventObj.GetEvents(strCurrentUser);

I have a dropdown in which it should have the dropdown menu as the EventName alone. How can I retrieve only the EventName from the list and display that in the dropdown?

  • 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-10T09:45:37+00:00Added an answer on June 10, 2026 at 9:45 am

    To display the EventName only to the dropdown, you will need to set the following two properties:

    • DataValueField to EventId.
    • DataTextField to EventName.

    Something like:

    dropdown.DataSource = ds;
    dropdown.DataValueField  = "EventID";
    dropdown.DataTextField = "EventName";
    dropdown.DataBind();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my list definition public class EventsList { public int EventID { get;
In this example: abstract class MyList<T>: List<T> { public T Find(int? id) { foreach(T
In C#, given a class definition like this: public class SomeObject { public String
I have this List<string> . How to get certain strings via LINQ? I guessed
I have the following DTO definition:- [DataContract] public class AddProductDTO { [DataMember] public string
Let's say I have the following class definition : List<SomeClass>... public class SomeClass {
Assuming the following view model definition: public class MyObject { public string Name {
Definition of my Class Public Class ProcessAlert Public LoanNumber As String Public EmailAddress As
I have the following method: public static string UlList(this HtmlHelper helper, List<IEntity> entities, string
Is this list-initialization of an array of unknown size valid in C++0x? int main()

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.