I have one repeater one page. Liek this
From To depart arrive operation
LHR JFK 25july 30aug ButtonDeleteSector
LHR JFK 25july 30aug ButtonDeleteSector
LHR JFK 25july 30aug ButtonDeleteSector
now, when I click particular button on particular row, then it should delete the clicked row. So I created this in html for the buttons
<td class="ItemTemplate" style="text-align: left; width: 75px;">
<asp:Button ID="btnDeleteSector" runat ="server" Text="Delete Sector" CommandName ="Delete" UseSubmitBehavior ="false"/>
</td>
And in the VB code
Protected Sub rptDatabaseItinerary_Delete_Sector(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptDatabaseItinerary.ItemCommand
If e.Item.ItemType = ListItemType.Item Then
Dim btnDeleteSector As Button = CType(e.Item.FindControl("btnDeleteSector"), Button)
Dim id As String = btnDeleteSector.CommandArgument
End If
If e.CommandName = "Delete" Then
For Each objSector As Calrom.BLL.Common.BookingModel.Sector In DatabaseBookingPart.Sectors()
If e.Item.ItemIndex = 0 Then
objSector.Status = BLL.Common.BookingModel.Status.Deleted
End If
Next
rptDatabaseItinerary.DataBind()
End If
End Sub
but it is deleting the all sectors, Can anyone tell me how can i select the particualr row and delete it.