This question is locked. New answers and comments are not allowed.
Hello,
I have to fix an existing GridView where some events are created to often. This occours only when scrolling in the grid.
The "CreateCellElement" Method is getting called several times and thus the events are being created too often.
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
... some code....
var lookup = new CustomCell(cell, dataItem, var, var2);
cell.MouseLeftButtonDown += lookup.OnMouseLeftButtonDown;
cell.KeyDown += lookup.OnKeyDown;
cell.KeyUp += lookup.OnKeyUp;
return lookup;
}
This happens when "EnableColumnVirtualization" and "EnableRowVirtualization" is set to true.
Well, i cant set them to false because the grid is allready too slow.
First i tried to delete the events with "-=" on "Unload" but that doesn´t work.
How can i prevent that the events getting attached?
Regards
I have to fix an existing GridView where some events are created to often. This occours only when scrolling in the grid.
The "CreateCellElement" Method is getting called several times and thus the events are being created too often.
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
... some code....
var lookup = new CustomCell(cell, dataItem, var, var2);
cell.MouseLeftButtonDown += lookup.OnMouseLeftButtonDown;
cell.KeyDown += lookup.OnKeyDown;
cell.KeyUp += lookup.OnKeyUp;
return lookup;
}
This happens when "EnableColumnVirtualization" and "EnableRowVirtualization" is set to true.
Well, i cant set them to false because the grid is allready too slow.
First i tried to delete the events with "-=" on "Unload" but that doesn´t work.
How can i prevent that the events getting attached?
Regards