i have a 1 datagridview in form1 and 1 listview in form2. the records in the datagridview are from my ms access also in my listview the records (items/subitems) are also in from the ms access. i do some deletion of records in the datagridview using vb.net. My problem is this, how i can delete records in the datagridview and in the listview just in one click at the same time?

If you are deleting the row from the gridview/listview AND the database...just refresh the data.

If not, you can try something like the following:

Private iRecord As Integer 'Set this to the datatype of your unique value

Public Property RowToDelete As Integer 'Set this to the datatype of your unique value
    Get
        return Me.iRecord
    End Get
    Set(value as Integer)
        Me.iRecord = value
    End Set
End Property

Now, when you delete the row from a - pass the unique to b - deleting it there as well.

If both are filled with the same exact data in the same order, you can simply use the row number

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.