SUB Delete_Command (Sender As Object, e as datagridcommandeventArgs)
'Retrieve The Data Table from Session State. Dim Dt As DataTable = CType (SESSION ("SOURCE"), DATATABLE
'Retrieve the data row to delete from the data table.' Use the DataKeys property of the DataGrid control to get 'the primary key value of the selected row.' Search the Rows collection of the data table for this value. Dim row As DataRow Row = dt.rows.find (itemsgrid.datakeys (E.Item.ItemIndex))
'Delete the item selected in the dtagrid from the data source. If not row is nothing the dt.rows.remove (row) endiff
'Save the data source. Session ("Source") = DT
'Create a DataView and Bind It to the DataGrid Control. DIM DV AS DATAVIEW = New DataView (DT) ItemsGrid.DataSource = DV ItemsGrid.Database ()
End Sub