A
anonymous
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.
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.