I generate a table on the fly in my page. For each row i have a radiobutton so the user can select an item on the table to view.

How can i add a validation control to check whether the user has selected a row in my table.

Currently i validate the control when the user hits the view button but when the button is click the tables data is not reloaded cos of the postback, maybe i should cache that?

VB Code:
  1. While (l_e.MoveNext = True)
  2.                     l_order = CType(l_e.Current, Order)
  3.                     Dim detailsRow As TableRow = New TableRow
  4.  
  5.                     Dim l_cellSelect As New TableCell
  6.                     Dim l_selector As New RadioButton
  7.                     l_selector.ID = l_order.OrderHeader.OrderHeaderId.ToString
  8.                     l_selector.GroupName = ORDER_SELECTION
  9.                     l_cellSelect.Controls.Add(l_selector)
  10.                     detailsRow.Cells.Add(l_cellSelect)
  11.  
  12.                     Dim l_nameCell As TableCell = New TableCell
  13.                     l_nameCell.Text = l_order.Customer.CustomerName
  14.                     detailsRow.Cells.Add(l_nameCell)
  15.  
  16.                     Dim l_dispatchCell As TableCell = New TableCell
  17.                     l_dispatchCell.Text = l_order.OrderHeader.DispatchNo.ToString
  18.                     detailsRow.Cells.Add(l_dispatchCell)
  19.  
  20.                     Dim l_poNoCell As TableCell = New TableCell
  21.                     l_poNoCell.Text = l_order.OrderHeader.CustPONo
  22.                     detailsRow.Cells.Add(l_poNoCell)
  23.  
  24.                     Dim l_poDateCell As TableCell = New TableCell
  25.                     l_poDateCell.Text = l_order.OrderHeader.CustPODate.ToString("dd/MM/yyyy")
  26.                     detailsRow.Cells.Add(l_poDateCell)
  27.  
  28.                     'Add the new row to the table.
  29.                     tblOrders.Rows.Add(detailsRow)
  30.                 End While