FlexGrid for WinForms
Scaling an Image
Show AllShow All
Hide AllHide All

To scale an image in a single column when the rows of the grid are resized, set the ImageAlign property to Scale.

  1. Set the row height of the first two rows by adding the following code to the Form_Load event:

    To write code in Visual Basic

    To write code in C#

  2. Scale the images in the column.

    In the Designer

    • Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid Column Editor, see Accessing the C1FlexGrid Column Editor.
    • Select the column that contains the images from the right pane and set the ImageAlign property to Scale in the left pane.
    • Click OK to close the editor.

    In Code

    Add the following code after the code in step 1:

    To write code in Visual Basic

    To write code in C#

This topic illustrates the following:

By using the ImageAlign property, the image will be scaled to fit the maximum area within the cell while preserving the picture's original aspect ratio.


See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback