RadioButtonList

Discussion in 'ASP .Net Datagrid Control' started by anonymous, May 10, 2005.

  1. anonymous

    anonymous Guest

    Maybe you can help me with the following logic I am trying
    to accomplish.
    My RadioButtonList is in datagrid <EditItemTemplate>
    column
    If my session in empty I have this code:

    Private Sub dgData_OnItemDataBound.....
    If Not rbList Is Nothing Then
    Dim index As String = ""
    index = DataBinder.Eval
    (e.Item.DataItem, "list")
    If index = "12" Then
    rbList .SelectedIndex = 0
    ElseIf index = "11" Then
    rbList .SelectedIndex = 2
    Else
    rbList .SelectedIndex = -1
    End If
    End If
    End If

    If in session I have row.Item("List") = "11" then remove
    item- >rbList.Items.RemoveAt(1).

    Private Sub dgData_OnItemDataBound.....
    If (dgData.EditItemIndex = e.Item.ItemIndex) Then
    Dim rbList As RadioButtonList = CType(e.Item.FindControl
    ("rbList"), RadioButtonList)
    Dim row As DataRow
    Dim i As String
    If rbList Is Nothing = False Then
    For Each row In Session(pageName).Tables
    (0).Rows
    If row.Item("List") = "11" Then
    rbList.Items.RemoveAt(1)
    rbList.Items.RemoveAt(1)
    End If

    Next
    It is working fine in cases above and when I adding a new
    row, but
    If I am editing the existing row where I had items(1) at
    the time when row was added
    to the session this item I need to dispay that items.
    That is where I get confused.
    Since I remove that item....

    In both cases the grid in edit mode.
    anonymous, May 10, 2005
    #1
    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. Ron
    Replies:
    2
    Views:
    762
    Sreejumon[MVP]
    Jul 1, 2003
  2. Leif
    Replies:
    1
    Views:
    414
    Helixpoint
    Jul 11, 2003
  3. Bob Hoke
    Replies:
    0
    Views:
    464
    Bob Hoke
    Jul 11, 2003
  4. Hazzard
    Replies:
    3
    Views:
    5,034
    Hazzard
    Jul 14, 2003
  5. Mike S
    Replies:
    1
    Views:
    1,062
    Mike S
    Jul 15, 2003
Loading...

Share This Page