Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Display different ToolTip message in different parts of the same DataGridView control

Display different ToolTip message in different parts of the same DataGridView control

Scheduled Pinned Locked Moved C#
cssquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Desmond Lim
    wrote on last edited by
    #1

    Hi, I'm trying to do this and am wondering if it is possible. I have a DataGridView control. I would like the ToolTip message to show some data (on the DataGridView itself) when the cursor is over that particular row in the control. If the cursor is out side the data rows but within the control (i.e. in the parts that have no data), I would like it to show another message. I have tried this.

    private void grid_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
    {
    if (e.RowIndex != -1 && ds.Information.Rows[e.RowIndex]["Value"] != null)
    {
    this.grid.CurrentCell.ToolTipText = ds.Information.Rows[e.RowIndex]["Value"].ToString();
    }
    else
    {
    toolTip.Show("Right-click to display menu", this.grid);
    }
    }

    What do I have to do to get it working? Thanks.

    modified on Wednesday, November 26, 2008 8:55 PM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups