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:
While (l_e.MoveNext = True) l_order = CType(l_e.Current, Order) Dim detailsRow As TableRow = New TableRow Dim l_cellSelect As New TableCell Dim l_selector As New RadioButton l_selector.ID = l_order.OrderHeader.OrderHeaderId.ToString l_selector.GroupName = ORDER_SELECTION l_cellSelect.Controls.Add(l_selector) detailsRow.Cells.Add(l_cellSelect) Dim l_nameCell As TableCell = New TableCell l_nameCell.Text = l_order.Customer.CustomerName detailsRow.Cells.Add(l_nameCell) Dim l_dispatchCell As TableCell = New TableCell l_dispatchCell.Text = l_order.OrderHeader.DispatchNo.ToString detailsRow.Cells.Add(l_dispatchCell) Dim l_poNoCell As TableCell = New TableCell l_poNoCell.Text = l_order.OrderHeader.CustPONo detailsRow.Cells.Add(l_poNoCell) Dim l_poDateCell As TableCell = New TableCell l_poDateCell.Text = l_order.OrderHeader.CustPODate.ToString("dd/MM/yyyy") detailsRow.Cells.Add(l_poDateCell) 'Add the new row to the table. tblOrders.Rows.Add(detailsRow) End While





Reply With Quote