I was looking to display a tooltip when I enter a cell and found this post:
viewtopic.php?f=21&t=15000&p=78696&hili ... tip#p78696
It appears there are C examples, but its a bit more complex for me however appears to be doable.
For example, I have a CSV with PCs,ModelTypes and PC Numbers
My DGV only shows( on purpose ):
Model Type | Count
I would like when I enter the cell containing the count to display the PCNumbers in a tooltip
Tooltip on Cell in DGV
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Tooltip on Cell in DGV
Here is one of a number of ways to do this. This method alows you to set the list on a cell.
https://docs.microsoft.com/en-us/dotnet ... ew=net-5.0
https://docs.microsoft.com/en-us/dotnet ... ew=net-5.0
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
Re: Tooltip on Cell in DGV
This statement is incorrect
For example, I have a CSV with PCs,ModelTypes and PC Numbers
It’s ModelTypes, Total counts, PCs of each type
Sorry
Thanks for the example, that’s the article that’s over my head
I know it’s a rare ask, I have another ask specific to you
Do you still have these files from this post?
http://tech-comments.blogspot.com/2017/ ... m.html?m=1
Appears they no longer exist on onedrive
For example, I have a CSV with PCs,ModelTypes and PC Numbers
It’s ModelTypes, Total counts, PCs of each type
Sorry
Thanks for the example, that’s the article that’s over my head
I know it’s a rare ask, I have another ask specific to you
Do you still have these files from this post?
http://tech-comments.blogspot.com/2017/ ... m.html?m=1
Appears they no longer exist on onedrive
Re: Tooltip on Cell in DGV
I don't understand, what is incorrect? Just add the field to the TooTipText of teh cell and it will display as a tooltip when hovered.
Simple example:
Here are the reconstituted sharreable links.
https://1drv.ms/u/s!AjiiPtIUqzK_hbMBVsK_ER1NyyCk7A
https://1drv.ms/u/s!AjiiPtIUqzK_hbMEzLcQXXeSDeKm1g
Simple example:
- $rowdata = @('ONE','TWO','THREE')
- $pclist = 'pc100,pc200,pc300'
- $form1_Load={
- $idx = $datagridview1.Rows.Add()
- $row = $datagridview1.Rows[$idx]
- $row.SetValues($rowdata)
- $row.Cells[0].ToolTipText = $pclist -replace ',',"`n"
- }
https://1drv.ms/u/s!AjiiPtIUqzK_hbMBVsK_ER1NyyCk7A
https://1drv.ms/u/s!AjiiPtIUqzK_hbMEzLcQXXeSDeKm1g
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
Re: Tooltip on Cell in DGV
Thank you, I don't have this implemented quite yet but you gave me the blocks and really appreciate the two other files.