A
anonymous
I need some help. I have 2 loops. One to find a
RadioButtonList in datagrid and
second in Session("Answ"). I am trying to assing value
from Session("Answ") to
RadioButtonList.selectedValue. However the value which is
selected is the last value in
session. Where did I mixed the logic.Thanks
Dim Answer As Answers
Dim dgItem As DataGridItem
For Each dgItem In dataGrid1.Items
If dgItem.ItemType =
ListItemType.AlternatingItem Or dgItem.ItemType =
ListItemType.Item Then
Dim rbl As RadioButtonList = CType
(dgItem.FindControl("rbList"), RadioButtonList)
For Each Answer In Session("Answ")
Dim aValue As String = Answer.rAnswer
rbList.SelectedValue = aValue
Next
End If
Next
RadioButtonList in datagrid and
second in Session("Answ"). I am trying to assing value
from Session("Answ") to
RadioButtonList.selectedValue. However the value which is
selected is the last value in
session. Where did I mixed the logic.Thanks
Dim Answer As Answers
Dim dgItem As DataGridItem
For Each dgItem In dataGrid1.Items
If dgItem.ItemType =
ListItemType.AlternatingItem Or dgItem.ItemType =
ListItemType.Item Then
Dim rbl As RadioButtonList = CType
(dgItem.FindControl("rbList"), RadioButtonList)
For Each Answer In Session("Answ")
Dim aValue As String = Answer.rAnswer
rbList.SelectedValue = aValue
Next
End If
Next