[]
        
(Showing Draft Content)

C1.Win.C1TrueDBGrid.C1TrueDBGrid.CellContaining

CellContaining Method

CellContaining(int, int, out int, out int)

Returns the cell position for a set of coordinates.

Declaration
public bool CellContaining(int x, int y, out int row, out int col)
Parameters
Type Name Description
int x

The x-coordinate.

int y

The y-coordinate.

int row

The row under the coordinate pair.

int col

The column index under the coordinate pair.

Returns
Type Description
bool

A value indicating whether a data cell is beneath the specified coordinate pair.

Remarks

The CellContaining method combines the ColContaining(int) and RowContaining(int) methods into one call. If the coordinate pair specified by x and y points to a data cell, this method returns True, and the rowindex and colindex arguments receive zero-based indexes that identify the cell.

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

If the specified coordinate is outside of the grid's data area, this method returns False. Use the PointAt(int, int) method to determine what kind of grid element, if any, is beneath the specified coordinate.