Delete/Remove Checked Items/Rows Listivew/Datagridview VBNET
Ini merupakan kelajutan dari "Remove Selected Item/Row Listview/Datagridview". jika sebelumnya menghapus/remove item/row yang dipilih/diblok (multi selected), sekarang bagaimana menghapus/remove row yang di checklist (asumsi kolom pertama = checkbox). Begini sintaknya :
1.DataGridViewPrivate Sub djieButtonDelete_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesdjieButtonDelete.Click
DoRemove:
For Each row AsDataGridViewRow In DataGridView1.Rows
Ifrow.Cells(0).Value = True Then 'checked
DataGridView1.Rows.Remove(row)
GoToDoRemove
EndIf
Next
End Sub
2.ListView
Private Sub djieButtonDelete_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesdjieButtonDelete.Click
For Each item AsListViewItem In ListView1.CheckedItems
item.Remove()
Next
End Sub
Tags:
remove checked item , cara hapus item yang di checklish di listivew, remove row yang dichecklish di datagridview,
Posting Komentar untuk "Delete/Remove Checked Items/Rows Listivew/Datagridview VBNET"