|
|
|
![]() |
|
Strumenti |
![]() |
#21 | |
Senior Member
Iscritto dal: Sep 2003
Messaggi: 1025
|
Quote:
questa è la funziona Public Function GetSelectedRows(ByVal dg As DataGrid) As System.Collections.ArrayList Dim al As New ArrayList Dim cm As CurrencyManager = Me.BindingContext(dg.DataSource, dg.DataMember) Dim dv As DataView = CType(cm.List, DataView) Dim i As Integer For i = 0 To dv.Count - 1 If dg.IsSelected(i) Then al.Add(i) End If Next Return al End Function questa la sub dell'evento click del pulsante "Elimina" Dim RemoveRow As DataRow Dim riga As Integer Dim numrighe As Integer Dim drview As New ListBox Dim a As Integer Dim c As Integer numrighe = GetSelectedRows(DgridArticoli).Count() For a = 0 To numrighe - 1 riga = GetSelectedRows(DgridArticoli).Item(a) drview.Items.Add(riga) Next For c = 0 To numrighe - 1 TableArticoli = dsArticolo.Tables("TblArticoli") RemoveRow = TableArticoli.Rows(drview.Items(c)) RemoveRow.Delete() Next |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 04:00.