RandyBlackburn
Programmer
I'm using the datagrid insert technique where a default record is inserted, then updated.
What I have found is that it is possible for a user to edit or delete another lineitem before updating or cancelling the insert.
How would I best solve this problem?
I guess I can hide the delete column, but how would I disable the edit link buttons on all the other records (including other pages)?
Also, I could give a javascript alert if they try to click on either an "edit" or "delete" link, but I'm not sure how to do that. I currently have the following logic already associated with the delete link button:
Private Sub CreditorGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles CreditorGrid.ItemCreated
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditItem
Dim myTableCell As TableCell
myTableCell = e.Item.Cells(13)
Dim myDeleteButton As LinkButton
myDeleteButton = myTableCell.Controls(0)
myDeleteButton.Attributes.Add("onclick", _
"return confirm('Are you Sure you want to delete this Creditor?');")
End Select
Thanks in advance,
Randy
What I have found is that it is possible for a user to edit or delete another lineitem before updating or cancelling the insert.
How would I best solve this problem?
I guess I can hide the delete column, but how would I disable the edit link buttons on all the other records (including other pages)?
Also, I could give a javascript alert if they try to click on either an "edit" or "delete" link, but I'm not sure how to do that. I currently have the following logic already associated with the delete link button:
Private Sub CreditorGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles CreditorGrid.ItemCreated
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditItem
Dim myTableCell As TableCell
myTableCell = e.Item.Cells(13)
Dim myDeleteButton As LinkButton
myDeleteButton = myTableCell.Controls(0)
myDeleteButton.Attributes.Add("onclick", _
"return confirm('Are you Sure you want to delete this Creditor?');")
End Select
Thanks in advance,
Randy