Is it possible when adding a custom control in a cell (or range of cells) to adapt the control size to the cell(s) size ?
I have added my control by doing this:
e.Style.CellType := ''Control'';
e.Style.Control := PictureBox1;
(I would like that my picture fit exactly the two cells in which it is).
ADAdministrator Syncfusion Team August 27, 2004 06:20 AM UTC
I think the control (pictureBox1) is automatically being sized to fit in the covered cell. (The grid can do this.) But it is the actual bitmap whose size you probably need to adjust, and the grid has no knowledge about what is in the control you are using. So, you will have to size the bitmap yourself somehow. You can use grid.RangeInfoToRectangle to get the size of the target rectangle you need. To see some techniques for sizing bitmaps, take a look at the Grid\Samples\DataBound\GridDataBoundImageCell sample. It sizes pcitures in a grid cell using vaious techniques.