Make other objects visible

Posted on 2005-05-03
Last Modified: 2010-04-23
I have a radiobuttonlist that has 3 values:


I also have a dropdownlist called "product", dropdownlist called "tank" and a textbox called "datetxt".

When the user selects "Product" from the radiolist I want the dropdownlist (product) to be visible and when the user selects from the radiolist "Tank", then I want the dropdownlist (tank) to be visible.  All of these controls, except for the radiolist are not visible on page_load.  The radiobuttonlist has autopostback set to True.  I thought I could write something like this, but it doesn't work.

If RadioButtonList1.SelectedItem.Text = "Product" Then
   product.Visible = True
End If
Question by:johnqtr
    LVL 13

    Expert Comment

    Have you tried this?

    If RadioButton1.Checked = True
      Product.visible = true
    End If
    LVL 27

    Accepted Solution

    Sample for radio buttons....

      Private Sub PickRadio_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.Click, RadioButton2.Click, RadioButton3.Click
    'Use the tag properities  in the radio button to easily find which button
            Select Case sender.tag
                Case 1
                     product.Visible = True
                    tank.Visible = False
                    datetxt.Visible = False            
                Case 2
                     product.Visible = False
                     tank.Visible = True
                  datetxt.Visible = False            
                Case 3
                    product.Visible = False
                    tank.Visible = False
                    datetxt.Visible = True            
            End Select
        End Sub

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    This video discusses moving either the default database or any database to a new volume.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now