Problem detecting deletion in dataset (in datagrid)

Discussion in 'ASP .Net Datagrid Control' started by Flare, Feb 22, 2004.

  1. Flare

    Flare Guest

    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
     
    Flare, Feb 22, 2004
    #1
    1. Advertising

  2. 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.
     
    Barnabas (Barney) Yohannes, Feb 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BlueFrog

    File Deletion Problem

    BlueFrog, Feb 16, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    623
    BlueFrog
    Feb 17, 2005
  2. Dan
    Replies:
    1
    Views:
    357
  3. Morten Aune Lyrstad

    Detecting object deletion while in a loop

    Morten Aune Lyrstad, Jan 3, 2005, in forum: C++
    Replies:
    7
    Views:
    298
    Morten Aune Lyrstad
    Jan 3, 2005
  4. jeff
    Replies:
    1
    Views:
    287
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Aug 16, 2003
  5. Sk8Kid

    Deque Item Deletion Problem

    Sk8Kid, Apr 1, 2006, in forum: C++
    Replies:
    2
    Views:
    317
    Csaba
    Apr 8, 2006
Loading...

Share This Page