Load background image of grid.

Posted by: damianrm-fp on 8 September 2017, 2:09 pm EST

  • Posted 8 September 2017, 2:09 pm EST

    <SPAN style="mso-ansi-language:EN-US;"><FONT face=Calibri>Dear FarPoint Team<o:p></o:p></FONT></SPAN>

    <SPAN style="mso-ansi-language:EN-US;"><o:p><FONT face=Calibri> </FONT></o:p></SPAN>

    <SPAN style="mso-ansi-language:EN-US;"><FONT face=Calibri>After 30 min. searching I give up and decide to ask you. Look pic.1 with you grid. It look ok, but I want to make it look better and for this I want to put background picture over you grid in space where have no rows. Like is show on second pic.<o:p></o:p></FONT></SPAN>

    <SPAN style="mso-ansi-language:EN-US;"><o:p><FONT face=Calibri> </FONT></o:p></SPAN><SPAN style="mso-ansi-language:EN-US;"><FONT face=Calibri><SPAN style="mso-spacerun:yes;"> </SPAN>Or if not possible to load image, at least from where I to change this color ?<o:p></o:p></FONT></SPAN>

    <SPAN style="mso-ansi-language:EN-US;"><o:p><FONT face=Calibri> </FONT></o:p></SPAN><SPAN style="mso-ansi-language:EN-US;"><FONT face=Calibri>Or watermark (same background but over all grid). How to do this ?<o:p></o:p></FONT></SPAN>

    <SPAN style="mso-ansi-language:EN-US;"><FONT face=Calibri>I use this code, it not produce error but ir replace colur in row with text. I want to add this backgorund in free of rows space as is show on pic.</FONT></SPAN>

    <SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-no-proof:yes;"><SPAN style="mso-spacerun:yes;">            </SPAN>grd.BackgroundImageLayout = <SPAN style="COLOR:#2b91af;">ImageLayout</SPAN>.Stretch;<o:p></o:p></SPAN>

    <SPAN style="LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-no-proof:yes;"><SPAN style="mso-spacerun:yes;">            </SPAN>grd.BackgroundImage = System.Drawing.<SPAN style="COLOR:#2b91af;">Image</SPAN>.FromFile(@Application.StartupPath + <SPAN style="COLOR:#a31515;">\\grd_backgroud.jpg</SPAN>);</SPAN>

    <SPAN style="LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-no-proof:yes;"></SPAN><SPAN style="mso-ansi-language:EN-US;"><o:p></o:p></SPAN><FONT size=2><FONT size=2>

    grd.ActiveSheet.DefaultStyle.BackColor = </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>Color</FONT></FONT><FONT size=2>.FromArgb(10);

  • Replied 8 September 2017, 2:09 pm EST

    Hello DamianRM,

    It is not possible to set the image in the gray area i.e. area between the sheet and the edge of the control. But we can set the color of the gray area using the code given as follows:


    fpSpread1.InterfaceRenderer = null;
    fpSpread1.Sheets[0].GrayAreaBackColor = Color.Coral;


    Here you need to set the InterfaceRenderer to null else you do not see the GrayAreaBackColor since the InterfaceRenderer paints the color for that part of the Spread based on it's settings.

    Hope this will help. Thanks.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels