We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

fit custom control to grid cell ?

Thread ID:

Created:

Updated:

Platform:

Replies:

18284 Aug 27,2004 02:03 AM Aug 27,2004 02:20 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 27, 2004 02:03 AM

Hi, 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''; grid.CoveredRanges.Add(GridRangeInfo.Cells(3,4,4,4)); e.Style.Control := PictureBox1; (I would like that my picture fit exactly the two cells in which it is). Verane.

Administrator [Syncfusion]
Replied On August 27, 2004 02:20 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;