Border width and IsReservedLocation

Posted by: alkonaut on 8 September 2017, 12:52 pm EST

  • Posted 8 September 2017, 12:52 pm EST


    If I make a custom cell type and override PaintCell( ) and IsReservedLocation( ) am I correct in that the rectangles passed to these methods will be different? In PaintCell I seem to get the rectangle inside the border, and in IsReservedLocation( ) I get the rectangle of the entire cell including the border?

    For example: If I paint a control (say, a checkbox) in Paint( ) at x,y=0,0 and then need to know wether the user has clicked on it in IsReservedLocation( ) then the checkbox will have slightly different coordinates depending on the border width? In that case I will need to know the border width, but that is not part of the appearance.

    Thanks for any advice
    / Anders
  • Replied 8 September 2017, 12:52 pm EST


    This is a bug in the Spread control. I reported this as bug #21493 for the development team to fix for the next maintenance release. The rectangle passed into both of these methods should be the rectangle that the editor will display in when going into editmode, which is inside the borders. Originally, the editor filled the cells with the borders painting over them. This has changed to only draw the editor inside the border. The rectangle passed into PaintCell was modified, but not so with the rectangle passed into IsReservedLocation. We will fix this for the next maintenacne release.

Need extra support?

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

Learn More

Forum Channels