Hi,
ich hab ein gebundenes Datagridview , ich gehe auf eine Zelle und ändere deren Inhalt, anschließend prüfe ich (zur Kontrolle) :
private void MyRowLeaved(DataGridViewCellEventArgs e)
{
if (dataGridView1.IsCurrentRowDirty)
Console.WriteLine("Row is Dirty");
}
MyRowLeaved wird immer ausgeführt wenn ich die Zelle verlasse, egal ob mit Taste oder Maus Klick irgendwo hin, auch wenn ich am Rädchen drehe wird Row is Dirty ausgegeben.
Nur beim MouseWheel feuert das ListChangedEventArgs nicht , und setzt den Zelleninhalt zurück 🙁
private void Form1_MouseWheel(object sender, MouseEventArgs e)
{
if (e.Delta > 0) // On Scroll up mouse wheels.
{
_binding.Position = _binding.Position - 3;
}
else //scrolling down mouse wheels
{
_binding.Position = _binding.Position + 3;
}
}
private async void binding_ListChanged(object sender, ListChangedEventArgs e)
{
switch (e.ListChangedType)
{
....
}
}
Worran könnte das liegen?
Danke
gruß
Peter
[EDIT]
DGV EndEdit() vergessen 🙂 Dann klappts...
private void Form1_MouseWheel(object sender, MouseEventArgs e)
{
datagridview.EndEdit();
if (e.Delta > 0) // On Scroll up mouse wheels.
{
_binding.Position = _binding.Position - 3;
}
else //scrolling down mouse wheels
{
_binding.Position = _binding.Position + 3;
}
}