ComponentOne True DBGrid Pro 8
ColContaining Method

 

Object Reference> True DBGrid Methods> ColContaining Method

ColContaining Method

The ColContaining method returns the ColIndex value of the grid column containing the specified coordinate. This value ranges from 0 to Columns.Count - 1.

Syntax

object.ColContaining(coordinate)

Arguments

coordinate is a single that defines a horizontal coordinate (X value) in twips.

Return Value

An integer corresponding to the index of the column beneath the specified X coordinate.

Remarks

This method is useful when working with mouse and drag events when you are trying to determine where the user clicked or dropped another control in terms of a grid column.

If coordinate is outside of the grid's data area, this method returns -1.

The ColContaining method returns the ColIndex of the column indicated, not the visible column position. For example, if coordinate falls within the first visible column, but two columns have been scrolled off the left side of the control, the ColContaining method returns 2, not 0 (assuming that the user did not move any columns previously).

Note

You must convert the coordinate argument to twips, even if the container's ScaleMode (Visual Basic) setting specifies a different unit of measurement.

See Also

TDBGrid Control

TDBDropDown Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback