I have 2 grids on my page, grid1 and grid2. I have a row delete button in grid1. When I click on this delete button I delete the row in grid1 and in my stored proc I also delete any associated data in another table which is grid2.
I am calling the delete button in code behind from the _ItemCommand event of grid1.
Protected Sub rgListingWithImages_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgListingWithImages.ItemCommand
'1. Check which alpha character was selected and then rebind the data to the grid
'2. Redirect to another page when SalesID, Email, Notes or PwdReset is selected
Dim value As String = Nothing
Select Case e.CommandName
Case ("DeleteRow")
Dim myItem As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim CustID As TableCell = myItem("CustomerID")
Dim OrdID As TableCell = myItem("OrderID")
Dim ListNo As TableCell = myItem("BusinessListingNumber")
'Delete specific listing row with slides WS = with slides
Dim BusList As New BusinessListingsPlanAndPricing
BusList.DeleteOneRowInBusinessListings(CustID.Text, OrdID.Text,
CInt(ListNo.Text), "WS")
'Display listings
LoadListingsGridWithSlides()
'Price
CalculateBusinessCostAndDisplay()
LoadSlidesGrid()
Exit Select
Case ("Select")
Exit Select
End Select
End Sub
Heres my issue: The data is deleted from the database but grid2 is still displaying the data. I have call a subroutine to refresh the grid datasource but this does not work. It only clears when I click on a delete button in grid2.
How do I call the delete event in grid2 from grid1 to refresh grid2?
many thanks