Thank you for the information.
Now, how do I reference each row? Here is the code I am using:
Private Sub dlYesNo_ItemDat aBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data ListItemEventAr gs) Handles
dlYesNo.ItemDat aBound
Dim ds As DataSet
Dim dr As DataRow
Dim strSQL As String
Dim rd As New ClassSurvey.Dat aTransfer
strSQL = String.Format(" Select QuesID, Question, QuestionType from
tblQuestions;")
'Get a DataSet from the SQL and the Connection String
ds = rd.GetDataSet(s trSQL, rd.CONN_STR)
For Each dr In ds.Tables(0).Ro ws
Debug.WriteLine (dr.Item("QuesI D"))
If CStr(dr.Item("Q uesID")) = "1" Or CStr(dr.Item("Q uesID")) = "4" Then
e.Item.FindCont rol("rblQues3") .Visible = False
Else
e.Item.FindCont rol("rblQues3") .Visible = True
End If
Next
I know this isn't pretty code, but it make that RadioListBox invisible for
all the rows.
What is the best way to approach this?
Thanks again for all your help.
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Gummy,
In the situation you describe I would use a repeater with a column
template. Then I'd use the repeater's ItemDataBound event to examine the data and
set controls in the current row visible/hidden as necessary.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Gummy" <gu***@nowhere. com> wrote in message
news:11******** *****@corp.supe rnews.com... Hello,
I know I can use a Checkboxlist or a RadioButtonList to easily create a
list
based on the data passed to it.
But using what if I wanted to use the same data and based on the data,
return either a textbox or checkbox (or even a user control). What is
the best way to do that?
Thanks for the help.
-Gummy