I have one ListBox which has three Items in it. And also has one GridView and One Button.
I want to move the selected items in the listbox to the GridView when the Button is clicked.
Now the problem is, if I selects the third item in the listbox and clicks the button, It always moves the first item in the ListBox to the GridView.
How to solve this?
<asp:ListBox ID="lbDrawing" runat="server" AutoPostBack="false" Height="260px" TabIndex="12" Width="150px"></asp:ListBox>
In the Button click event, I select the item by the following C# code,
string itemsname = lbDrawing.Items[lbDrawing.SelectedIndex].Text;
Anyone please help me.
Here, I fill the ListBox based the DropDownList SelectedIndex Changed Event. So I can not bind the ListBox in the Page is not PostBack Block.