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.