2012-01-02 68 views
0

我在Windows窗体中有数据中继器,数据中继器内有一个标签和一个单选按钮或组合框,单选按钮的数量和文本是从我的数据库中引入的,就像标签和组合框一样。获取数据中继器中单选按钮的状态

标签是一个问题,单选按钮或组合框允许用户回答问题。

我想要做的是获取单选按钮的选中状态,以便我可以在需要时显示下一个问题。例如只显示问题2如果问题1回答号

回答

0
'0 = Index in Repeater. 
Dim bolChecked As Boolean = CType(rptYourRepeater.Items(0).FindControl("IdOfRadioButton"), RadioButton).Checked 
+0

我得到的,说:“‘物品’不是‘Microsoft.VisualBasic.PowerPacks.DataRepeater’成员” – willj12 2012-01-02 18:56:31

+0

我得到了一些它的工作的错误,当你点击一个按钮时,如果它被选中,它会显示一个真或假的消息框。 'Dim bolChecked As Boolean = CType(rptYourRepeater.CurrentItem.Controls(“IdOfRadioButton”),RadioButton).Checked MsgBox(bolChecked)' – willj12 2012-01-02 19:16:29

+0

我很抱歉混淆了DataRepeater和Repeater Controls,并且很高兴您能够正常工作。 – N0Alias 2012-01-02 21:01:46

相关问题