Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Problem detecting deletion in dataset (in datagrid)

Reply
Thread Tools

Problem detecting deletion in dataset (in datagrid)

 
 
Flare
Guest
Posts: n/a
 
      02-22-2004
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



 
Reply With Quote
 
 
 
 
Barnabas (Barney) Yohannes
Guest
Posts: n/a
 
      02-23-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in the aggregation concept.(during deletion of the pointer of other class). Aff@n C++ 1 10-16-2006 05:08 AM
Deque Item Deletion Problem Sk8Kid C++ 2 04-07-2006 11:59 PM
File Deletion Problem BlueFrog ASP .Net 5 02-17-2005 01:32 AM
Detecting object deletion while in a loop Morten Aune Lyrstad C++ 7 01-03-2005 10:13 PM
detecting -addition, deletion or change to files jeff Python 1 08-16-2003 01:43 PM



Advertisments