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?
To display the
EventNameonly to the dropdown, you will need to set the following two properties:DataValueFieldtoEventId.DataTextFieldtoEventName.Something like: