I have added a template column of dropdownlist to the datagrid, with 2
options ("No Change" and "Delete") on each dropdownlist. "No Change" is
selected by default during design time.
The user will mark the grid items to delete by selecting the "Delete"
option. The user can then click the DELETE button (not on the datagrid, but
on the form) to delete all marked grid items in one batch.
I am trying to loop thru grid items to build SQL DELETE query, by checking
the following:
Dim lcboAction As DropDownList
lcboAction =
CType(Me.gridDisplay.Items(lnIndex).Cells(0).Controls(0).FindControl("cboAction"), DropDownList)
However, lcboAction.SelectedValue always equals to "No Change" even for the
ones I have marked as "Delete". Why? Am I missing something here?
Thanks in advance,
Richard