GrapeCity MultiRow Windows Forms Documentation
Zooming

In MultiRow, you can zoom the contents of the grid using the stretch and pinch gesture. This section describes the feature to zoom the grid, using touch.

Setting the Minimum Zoom Percentage

You can use the MinZoomFactor property to set the minimum zoom percentage. If you zoom to less than the minimum zoom percentage using the pinch gesture, the screen reverts back to the zoom percentage that is set in the MinZoomFactor property.

Using Code

The following code sets the minimum zoom percentage to 100%.

[VB]

GcMultiRow1.MinZoomFactor = 1.0F

[CS]

gcMultiRow1.MinZoomFactor = 1.0F;

Adding a Snap Point

You can use the TouchZoomSnapPoints property to set the snap point of the zoom. If the snap point is set, the zoom percentage is automatically set to the nearest snap point when you interrupt the stretch or pinch operation by removing your finger from the screen.

Using Designer

Use the following steps to add a snap point.


  1. Select the GcMultiRow control (for example, gcMultiRow1).
  2. From the Properties window, select the TouchZoomSnapPoints property and click the ... button.
  3. In the Single Collection Editor, click the Add button.
  4. Select the item added to the members, and add any value in the range of 0-4 to the Value property in the property grid.
  5. Click the OK button and close the Single Collection Editor.

You can also add a snap point with code. You can use the Add or AddRange method to add a snap point.

Using Code

This example uses the Add or AddRange method to add a snap point.

[VB]

' Add a snap point of zoom percentage, using the Add method. 
GcMultiRow1.TouchZoomSnapPoints.Add(1.5F)
GcMultiRow1.TouchZoomSnapPoints.Add(2.0F) 
GcMultiRow1.TouchZoomSnapPoints.Add(2.5F) 
' Add a zoom percentage snap point, using the AddRange method.
GcMultiRow1.TouchZoomSnapPoints.AddRange(New Single() {3.0F, 3.5F})

[CS]

// Add a snap point of zoom percentage, using the Add method.
gcMultiRow1.TouchZoomSnapPoints.Add(1.5F); 
gcMultiRow1.TouchZoomSnapPoints.Add(2F); 
gcMultiRow1.TouchZoomSnapPoints.Add(2.5F); 
// Add a zoom percentage snap point, using the AddRange method. 
gcMultiRow1.TouchZoomSnapPoints.AddRange(new float[] { 3F, 3.5F });

You need to zoom to a value greater than the value set in the TouchZoomSnapDistance property, so that the zoom percentage is automatically set and uses the snap point. For example, if the TouchZoomSnapDistance property is set to 1, the zoom percentage is not set automatically to the snap point, unless you change the zoom percentage to 100% or more, by a single stretch or pinch operation.

Using Code

This example sets the TouchZoomSnapDistance property.

[VB]

' The zoom percentage is automatically set when the 
'zoom percentage is changed to 50% or more. GcMultiRow1.TouchZoomSnapDistance = 0.5F

[CS]

// The zoom percentage is automatically set when the 
//zoom percentage is changed to 50% or more. gcMultiRow1.TouchZoomSnapDistance = 0.5F;

Disabling Zoom

Setting the AllowUserToTouchZoom property to False disables zooming using the touch operation. By disabling the zoom operation using touch, you can prevent accidental zooming while scrolling or other operations.

Using Code

This example sets the AllowUserToTouchZoom property.

[VB]

GcMultiRow1.AllowUserToTouchZoom = False

[CS]

gcMultiRow1.AllowUserToTouchZoom = false;
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options