If you run your project now, you will receive Figure 3, but
when you click process nothing happens (except posting back the page).
Figure 3
In order to process the rows after user selection of
options, you have to post the following code segment for the BtnProcess click
event.
Listing 3
Private Sub BtnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles BtnProcess.Click
Dim RequestString As String, Ind As DataGridItem, RequestValue As String, RowNumber As Long
RowNumber = 1
For Each Ind In DataGrid1.Items
RequestString = "mycheckoption" & Ind.ItemIndex
If Ind.ItemType = ListItemType.AlternatingItem Or Ind.ItemType = ListItemType.Item Then
Dim r As Label
r = Ind.FindControl("LblStatus")
RequestString = "mycheckoption" & Ind.ItemIndex
RequestValue = Request.Form(RequestString)
TxtProcess.Text = TxtProcess.Text & "Row " & RowNumber & " has status " & RequestValue & vbCrLf
RowNumber + = 1
End If
Next
End Sub
Now run your project and make your selections then click the
process button. Something similar to Figure 4 should happen depending on your
selection.
Figure 4