TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
User107
NA
28
17.6k
Is it possible to display selected items in dropdowncheckbox
Sep 16 2016 1:44 AM
In asp.net web application, i have dropdowncheckboxes control in that whatever items i selected i need to show that selected items in dropdown textfield as separated with comma.
I tried this code but i am not getting result:
protected void dropdown1_SelectedIndexChanged(object sender, EventArgs e)
{
List<String> checkedList = new List<string>();
foreach (ListItem item in dropdown1.Items)
{
if (item.Selected)
{
checkedList.Add(item.Text);
}
dropdown1.DataTextField = String.Join(",", checkedList);
}
}
My screen shots for this:
in My dropdown1 has many items i need to select two items i.e., shown in below figure
what i select items from dropdown it will display on text field as like below figure
Can anyone please tell me how to do this.
thank you
Reply
Answers (
2
)
curd operation inside the grid in mvc4 by using model popup
How do I update the changes of the radio button selection ?