Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
790
Grid background outside of Rounded Borders
posted

I am using a grid with a Rounded4Thick border style on a dark background.  My requirements call for the background inside the border to be white, so I am setting the BackColor to Color.White.  The result leaves the small white spots in the area outside the border but inside the grid's rectangle...see the attachment.

Does anyone know of a way to set the color for that area...or at least set it to transparent?

Thanks,

Darin

P.S. Sorry for the ugly image...tried a few things to make it better but had no luck.

Parents
  • 37774
    Verified Answer
    posted

    Darin,

    In order for the BackColor to not paint in that section, you would need to calculate the region of the control yourself.  Fortunately, there is already a method that will calculate this region based on the border style:

     this.ultraGrid1.Region = DrawUtility.CreateBorderRegion(new Rectangle(Point.Empty, this.ultraGrid1.Size), this.ultraGrid1.DisplayLayout.BorderStyle);

    You just have to make sure that you refresh this region each time that the grid is resized for whatever reason (i.e. docked/anchored in a form).

    -Matt

Reply Children