Problem detecting deletion in dataset (in datagrid)

F

Flare

Hi

I have set at dataset as source for my datagrid.

When i want to store my changes in the datasource I call the
dataSet.GetChanges() wich should return all rows with changes...It does
except for the rows wich i have deleted. They aint represented in the
returning dataset.

How do i detect wich rows has been deleted from my dataSet? Does the
dataGrid handle the deletin wrong, so i cant detect deletion or have I
misundestooed the GetChanges.

I see there is a problem representing a row wich doesent excist....But what
should I do then?

Regards
Anders, Denmark
 
B

Barnabas (Barney) Yohannes

In your html

<asp:datagrid id="masterGrid" ...... OnItemCreated="MyDataGrid_ItemCreated" ........</asp:datagrid

'In your VB Code


Sub MyDataGrid_ItemCreated(ByVal Sender As Object, ByVal e As DataGridItemEventArgs

Select Case e.Item.ItemTyp
Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditIte
Dim myTableCell As TableCel
myTableCell = e.Item.Cells(2
Dim myDeleteButton As LinkButto
myDeleteButton = myTableCell.Controls(0
myDeleteButton.Attributes.Add("onclick", "return confirm('Do you really want to delet this row?');"
End Selec

End Su

That will create a JavaScript (or VB Script depends) that will detect deletion

Salutations
Barnabas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top