Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells
Hi,
we are using DataGridView in our application.I noticed that DataGridView.CellValueNeeded is called when i move the mouse over the cells.After some searching i found that When the mouse moves to a cell, the
DataGridView will show a tooltip to show the completed content of the cell if its value cannot be displayed completely in the cell. This will help the user see the complete content of the cell when necessary and it is
the default behavior of the DataGridView. As a result, the CellValueNeeded event will be fired when we move the mouse on it, since it needs the value to format and construct the ToolTip. I don't know if it is correct in my case.Is it?if yes is there anyway to avoid it?
Thank you
Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells
May I ask why you want to avoid that event being raised?
Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells
Quote:
Originally Posted by
jmcilhinney
May I ask why you want to avoid that event being raised?
Because it may slow down datagridview loading and we don't need tooltip anyway
Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells
How is it going to slow down loading if it only happens when you mouse over a cell? Is it even when you mouse over or just when you hover? As for the tool tips, if you set the grid's ShowCellToolTips property to False then they won't be shown. Whether or not that will prevent that event being raised under those circumstances, I don't know, but raising an event is no big deal anyway if you haven't handled it.
Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells
Quote:
Originally Posted by
jmcilhinney
How is it going to slow down loading if it only happens when you mouse over a cell? Is it even when you mouse over or just when you hover? As for the tool tips, if you set the grid's ShowCellToolTips property to False then they won't be shown. Whether or not that will prevent that event being raised under those circumstances, I don't know, but raising an event is no big deal anyway if you haven't handled it.
Thanks.That is what i needed.