Posted 31 October 2024, 6:02 pm EST
Hello,
Looking to add an image to the RowIndicator Header area rectangle.
How to do this?
Thanks,
S
Forums Home / ComponentOne / WinForms Edition
Posted by: smcelroy on 31 October 2024, 6:02 pm EST
Posted 31 October 2024, 6:02 pm EST
Hello,
Looking to add an image to the RowIndicator Header area rectangle.
How to do this?
Thanks,
S
Posted 4 November 2024, 2:26 am EST
Hello,
As per our understanding, you want to display an image to represent the current row in the Row Header, i.e., intend to replace the current row Glyph with a custom image. If so, you can set the GlyphType.CurrentRow Glyph with your custom image as follows:
c1TrueDBGrid1.Glyphs[GlyphType.CurrentRow] = Image.FromStream(new MemoryStream(Properties.Resources.Arrow));
Please refer to the attached sample for implementation. (see TrueDBGrid_RowIndicator.zip)
If this is not what you intend to implement or if our understanding differs, please share more details on your use-case and update the attached sample accordingly.
Regards,
Uttkarsh.
Posted 4 November 2024, 2:35 am EST - Updated 4 November 2024, 2:40 am EST
Thanks for the reply, but sorry that’s not what I asked.
I asked about the HEADER AREA RECTANGLE that is ABOVE the first row. See image with the red arrow.
Thanks again,
S
Posted 4 November 2024, 8:11 am EST
Hello,
Thank you for attaching the image and pointing out the area.
To set the image in the header row, you can set the PictureHeaderRow property of the TrueDBGrid as follows:
c1TrueDBGrid1.PictureHeaderRow = new Bitmap(
Image.FromStream(new MemoryStream(Properties.Resources.Arrow)),
new Size(c1TrueDBGrid1.RowHeight, c1TrueDBGrid1.RowHeight));
Please refer to the attached modified sample for implementation. (see TrueDBGrid_RowIndicator_Mod.zip)
Regards,
Uttkarsh.
Posted 5 December 2024, 8:26 pm EST
Thank you, this works.
However, I’m trying now to set Hover text for this area. How do I do this? I don’t see that I have any x or y coordinates from the event:
_MouseHover(sender As Object, e As EventArgs)
How can I get whether my mouse is hovering over this HeaderRow area?
Thanks,
Sean
Posted 6 December 2024, 3:11 am EST
Hello Sean,
You can use the Control.MousePosition property to get the current mouse location and the C1SuperToolTip control in the FetchCellTips event to display hovering text.
Please refer to the attached sample for implementation. (see TrueDBGrid_RowHeaderToolTip.zip)
SuperToolTip overview: https://developer.mescius.com/componentone/docs/win/online-supertooltip/overview.html
Regards,
Uttkarsh.