Logic

Discussion in 'ASP .Net Datagrid Control' started by anonymous, Mar 29, 2005.

  1. anonymous

    anonymous Guest

    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
    anonymous, Mar 29, 2005
    #1
    1. Advertising

  2. Well, you are not looping through the checkbox controls and you are not
    creating new checkboxes so I would guess that is the problem.

    Jason Bentley
    http://geekswithblogs.net/jbentley
    Jason Bentley, Mar 30, 2005
    #2
    1. Advertising

  3. anonymous

    anonymous Guest

    Here is my code. I can't see what I am doing incorrect. I
    am honestly stuck...
    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
    anonymous, Mar 30, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Qunwei Chen
    Replies:
    6
    Views:
    3,636
    Renaud Pacalet
    Aug 22, 2003
  2. RZ
    Replies:
    2
    Views:
    509
  3. Cliff Cummings

    SystemVerilog: "logic" or "ulogic?"

    Cliff Cummings, Sep 16, 2003, in forum: VHDL
    Replies:
    7
    Views:
    4,130
    cc0139808
    Sep 20, 2003
  4. Richard B. Katz
    Replies:
    0
    Views:
    690
    Richard B. Katz
    Dec 4, 2003
  5. spike
    Replies:
    8
    Views:
    1,463
    Steve Holden
    Feb 9, 2010
Loading...

Share This Page