shy_wani 0 Light Poster

hi..good day to all..
i have a datagrid that combines 2 related tables as below:
<body>
<asp:datagrid id="dlQuestion" runat="server">
<ItemTemplate>
<b>Question :#</b>
<%# Container.DataItem("QuestionNum") %><br>
<%# Container.DataItem("Question") %>
<asp:DataList runat="server" Id="ChildDataList"
datasource='<%#Container.DataItem.Row.GetChildRows("myrelation") %>' RepeatColumns="1">
<ItemTemplate>
<%# Container.DataItem("OptionList") %>
</ItemTemplate>
</asp:DataList>
</ItemTemplate>
</asp:datalist>
</body>

the code behind as shown below:
Dim MySQL As String = "Select * from Question"
Dim ds As DataSet = New DataSet
Dim Cmd As New SqlDataAdapter(MySQL, MyConnection)
Cmd.Fill(ds, "Question")
Dim cmd2 As SqlDataAdapter = New SqlDataAdapter("select * from AnswerList", MyConnection)
cmd2.Fill(ds, "AnswerList")
ds.Relations.Add("myrelation", ds.Tables("Question").Columns("QuestionID"), ds.Tables("AnswerList").Columns("QuestionID"))

dlQuestion.DataSource = ds.Tables("Question").DefaultView
DataBind()


is it possible to display the AnswerList in radio button or checkboxes? in table Question..i have attribute "QuestionType" that defines whether the QuestionType="MultipleSingle" then it should be displayed with radio button, else if QuestionType="MultipleMultiple" the answerlist will display checkbox..
how can this be done??
please..if u guys can't help me with the code, perhaps with a suggestion of how i'm gonna solve this would be really helpful...thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.