Click here to Skip to main content
15,883,956 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

my Problem is an DataGridView named "Datenansicht".

Dim sql As String
Dim data As New DataSet
Dim dataShow As New DataSet

sql = "select Eintrag_ID, Erfasser, Kategorie, Uhrzeit from Nutzereinträge"

db.ReturnDatagrid(sql).Fill(dataShow)


This is how the DataGridView is filled.

Now there are Buttons who will filter the Entries in the "Datenansicht"

These re-set the DataGridView:

Dim sql As String = "select Value,ValueType from DropDownValues order by ValueType"
Dim data As New DataSet

sql = "select Erfasser, Kategorie, Uhrzeit from Nutzereinträge where Eintrag_ID Not in (Select Eintrag_ID from QMEinträge)"

db.ReturnDatagrid(sql).Fill(data)
Datenansicht.DataSource = Nothing
Datenansicht.DataSource = data.Tables(0)
Datenansicht.Refresh()


This works, the new, filtered entries are displayed in the "Datenansicht".

But it completely breaks the events that correspond with the DataGridView "Datenansicht"

Datenansicht_SelectionChanged
completely stops working

What I have tried:

I tried resetting the data source, clearing the whole datagridview... Nothing worked.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900