Thank you for the information.
Now, how do I reference each row? Here is the code I am using:
Private Sub dlYesNo_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataListItemEventArgs) Handles
dlYesNo.ItemDataBound
Dim ds As DataSet
Dim dr As DataRow
Dim strSQL As String
Dim rd As New ClassSurvey.DataTransfer
strSQL = String.Format("Select QuesID, Question, QuestionType from
tblQuestions;")
'Get a DataSet from the SQL and the Connection String
ds = rd.GetDataSet(strSQL, rd.CONN_STR)
For Each dr In ds.Tables(0).Rows
Debug.WriteLine(dr.Item("QuesID"))
If CStr(dr.Item("QuesID")) = "1" Or CStr(dr.Item("QuesID")) = "4" Then
e.Item.FindControl("rblQues3").Visible = False
Else
e.Item.FindControl("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****************@tk2msftngp13.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.supernews.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