Click here to Skip to main content
Click here to Skip to main content

How to Move List Box Items to another List Box in C#.

, 22 Jul 2007
Rate this:
Please Sign up or sign in to vote.
The article demonstrates how to Move List Box Items to another List Box in ASP.NET and C# .
Screenshot - ListBox.jpg

Introduction

An article to demonstrate How to Move List Box Items to another List Box in ASP.NET and C#.

About the solution

In many web applications it is required use list boxes. Sometimes it is necessary to select some items from one list to another. In this case we use two listboxes. This article demonstrates how to perform basic operations in such case. This operations include Add/Remove/Add All / Remove All functionalities.

Background

List Box control is a standard control in Asp.net. It is similar to a dropdownlist.

Code Snippets

<p style="TEXT-ALIGN: justify">Code to add selected item to the list 


</p>

<p style="TEXT-ALIGN: justify">Protected void btnAdd_Click(object sender, EventArgs e)
 {
 if (lstEmployees.SelectedIndex >

About Me

I am a Software Engineer handling web application projects using Visual studio 2005 .I work in bangalore.

History

Created on 23-07-2007 by George Zacharia

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

George Zacharia
Web Developer
India India
No Biography provided

Comments and Discussions

 
Questionplease give full code PinmemberShaikh Sameer7-Mar-14 5:45 
QuestionMultiple select in single "Add Click" PinmemberSajan S Jabbar20-Aug-12 22:33 
GeneralMy vote of 5 PinmemberFranco Cipriano20-Jul-12 1:50 
QuestionPage always reloads PinmemberFranco Cipriano20-Jul-12 1:47 
AnswerRe: Page always reloads PinmemberSajan S Jabbar20-Aug-12 22:34 
GeneralMy vote of 3 PinmemberJoaquin Garcia27-Jun-12 5:30 
QuestionExcellent.... Pinmemberthothoy28-Jul-11 21:43 
GeneralExcellent work PinmemberTanmay Ghosh1-Jun-11 3:43 
GeneralGreat Pinmemberkhrizz_tell8-May-09 7:35 
QuestionNikzad.Behrouz has question PinadminSean Ewington17-Aug-07 3:40 
QuestionListItem??? Pinmemberkboyette16-Aug-07 6:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 23 Jul 2007
Article Copyright 2007 by George Zacharia
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid