Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 25-Feb-13 20:31pm
hanigbl402
Comments
Sergey Alexandrovich Kryukov at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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: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:
 
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
  Permalink  
v2

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

  Print Answers RSS
0 Zoltán Zörgő 200
1 Sergey Alexandrovich Kryukov 160
2 Peter Leow 90
3 Ramza360 51
4 Arkadeep De 50
0 Zoltán Zörgő 80
1 the other paul 23
2 Shmuel Zang 10
3 Aarti Meswania 5
4 Member 11389991 -2


Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100