Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi..
I am using gridview control.i want to delete particular row on delete linkbutton.this link button i got by AutoGenerateDeleteButton=true.i am adding grvJV_RowDeleting method on delete button click it not works.function call infinite time some time it gaves stack overflow error some times it gives no source code available.

my code is

VB
Private Sub grvJV_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles grvJV.RowDeleting
       
        Dim dt As DataTable
        dt = ViewState("CurrentTable")
        dt.Rows.RemoveAt(e.RowIndex)
        ViewState("CurrentTable") = dt
      
        grvJV.DeleteRow(e.rowindex)
    End Sub
Posted

Hi, As per my understanding,
grvJV.DeleteRow(e.rowindex) placed before the end is calling the function again in a recursive way.
Plus I cannot see any code for deleting a record written over here.
The grid view just gives you the 'e' eventArgs to fetch the information of the row you have clicked on.Further process of deleting the row should be performed through code by firing appropriate query to the database.
 
Share this answer
 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900