How can I determine if a "delete" links was clicked?
My aspx page has
<telerik:RadGrid ID="radGrid" runat="server"
.......
OnDeleteCommand="RadGrid_DeleteCommand"
>
<telerik:GridButtonColumn CommandName="Delete" Text="Delete"
UniqueName= "DeleteColumn"></telerik:GridButtonColumn>
In my codebehind I want to check to see if the delete was clicked:
Dim DeleteWasClicked as boolean
If IsPostback() then
DeleteWasClicked = ????
end if
' I ahso have the follwing to delete the record (which works fine)
Protected Sub RadGrid_DeleteCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
'Get the GridDataItem of the RadGrid
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
'Get the primary key value using the DataKeyValue.
Dim PrmaryKeyID As String = item.OwnerTableView.DataKeyValues(item.ItemIndex)("CustomerID").ToString()
Dim deleteQuery As String = "DELETE from "....
' Run the query
End Sub