Click here to Skip to main content
13,150,622 members (39,214 online)
Rate this:
Please Sign up or sign in to 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 25-Feb-13 19:31pm
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.

1 solution

Rate this: bad
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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170924.2 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2017
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