954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

show item in panel

hi..
i wanna ask...how can i add controls such as RadioButton @ CheckBoxes @ TextBox into panel?

i need to view my OptionList based on my QuestionType

Dim sql As SqlCommand=("SELECT Question.QuestionTypeID,AnswerList.OptionID,AnswerList.OptionList FROM QUESTION, AnswerList WHERE AnswerList.SurveyID = 83 AND AnswerList.QuestionNum=1",MyConn)
Dim readQ As SqlDataReader = sql.ExecuteReader()

 While readQ.Read
            Dim qtype As String = readQ("QuestionTypeID").ToString
            If qtype = 1 Then
                Dim rad As New RadioButtonList
                With rad
                    .DataSource = readQ
                    .DataValueField = "OptionID"
                    .DataTextField = "OptionList"
                    putOption.Controls.Add(rad)
            
                End With
            ElseIf qtype = 2 Then
                Dim chk As New CheckBoxList
                With chk
                    .DataSource = readQ
                    .DataValueField = "OptionID"
                    .DataTextField = "OptionList"
                    putOption.Controls.Add(chk)
                End With
            Else
                Dim txtbox As New TextBox
                putOption.Controls.Add(txtbox)
            End If
        End While


fyi, putOption is the panel which i want to insert my controls...

please guide me..help is very much appreciated..

shy_wani
Light Poster
34 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

In addition...Right now, all the controls didn't show up in page_load\

where did i do wrong?


~i want to learn~

shy_wani
Light Poster
34 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You