Results 1 to 5 of 5

Thread: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells

    May I ask why you want to avoid that event being raised?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells

    Quote Originally Posted by jmcilhinney View Post
    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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Avoiding calling of DataGridView.CellValueNeededc when mouse moves over cells

    Quote Originally Posted by jmcilhinney View Post
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width