Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a problem to change already item in textbox after click combo box item. I add item like equipmentID,equipmentItem(combobox),model(combobox),quantity, serialnumber and status in form Equipment. I want item status(textbox) change automatic from available to unvailable after edit the equipmentItem(combobox). Anybody can help me??
Posted
Comments
Sergey Alexandrovich Kryukov 21-Mar-13 22:06pm    
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA

1 solution

You can use the SelectedIndexChanged event for the combobox in the VB code behind. Add code in this event to change the textbox.

You will also have to be sure the AutoPostBack property of the combobox is set to True. This way whenever the combobox is changed, the page will postback and the code in the SelectedIndexChanged event will run.

Good luck!

Update: 27 Feb 2013
The AutoPostBack property is not in the VB code. You can find it by clicking on the combobox in the designer and then looking in the properties window. You can also change it directly in the ASP.NET code. Something like this:

ASP
<asp:DropDownList ID="SomeComboBox" runat="server" AutoPostBack="True"></asp:DropDownList>


Then you will need code to change the textbox in the SelectedIndexChanged event in the VB code. Something like this:

VB
Private Sub SomeComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SomeComboBox.SelectedIndexChanged
   'Code to change textbox here
   If SomeTextBox.Text = "available" Then SomeTextBox.Text = "unavailable"
End Sub
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900