move Listbox items to another listbox without button click

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinod allapu
    New Member
    • Apr 2009
    • 28

    move Listbox items to another listbox without button click

    hi all,

    i am trying to generate a report, iam using sql server 2000 and Asp.net 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
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Could you post some code? What have you tried so far? Look into SelectedIndexCh anged .... Set AutoPostBack property of Listbox to true...

    Comment

    • sangam56
      New Member
      • Nov 2007
      • 68

      #3
      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 SelectedIndexCh anged event of the source listbox. Here in Moving Items from one listbox to another in asp.net web page using C#, you can see the code.

      Hope this helps. Thanks.

      Comment

      Working...