Deleting Row From DataTable...

jarrah001

New Member
Hello All,<BR><BR>I am having some trouble deleting a row from a datatable, basically what I need to happen is relate the DataKey of the row I want to delete that is in a DataGrid, to the row array number of the DataTable.<BR><BR>Is there any way to explictly tell the DataTable to delete a row based on a condition? For example the logic would be something like this, even though the syntax is probably all wrong:<BR><BR>DataTable.Row(x).Delete .... Where x would be the 'DataKey' returned by the DataGrid...<BR><BR>any help would be appreciated.. thanks-Create a column with a hyperlink or button column called "Delete"<BR>-create a command name called "delete" for that column<BR>-in the <asp:datalist...> tag set the OnDeleteCommand to the function that deletes the item from you table source<BR>-rebind your source to the table when you're done
 
Back
Top