By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,878 Members | 1,341 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,878 IT Pros & Developers. It's quick & easy.

move Listbox items to another listbox without button click

P: 28
hi all,

i am trying to generate a report, iam using sql server 2000 and 2.0. First to select the columns iam using the list box... as we can order by the query result from the selected columns only, i want to use another list box which contains only selected columns..
1. Iam filling the columns names required into the listbox it is selecting the columns in the select statement to generate report.
2. I have another list box in which the columns names for order by condition, which were selected in the first listbox.(if any item is selected in the first listbox, then that item should be displayed in the second listbox(order by listbox). and if the item in the first list box is unselected then that item should not be present in the second listbox(order by list box) and it should be done without the user action (contains no buttons for adding and removing items).
Can You Please make me know whether it is possible.. if yes can u please give me an idea with a sample code....

Thank you boss
May 18 '09 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 750
Could you post some code? What have you tried so far? Look into SelectedIndexChanged .... Set AutoPostBack property of Listbox to true...
May 18 '09 #2

P: 68
Hi Vinod,
As you have said, to move items from one listbox to another, you can utilize the same concept which is used when moving items on button clicked. You just need to execute the codes on SelectedIndexChanged event of the source listbox. Here in Moving Items from one listbox to another in web page using C#, you can see the code.

Hope this helps. Thanks.
May 18 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.