Spread Windows Forms 12.0 Product Documentation
GetCellRectangle Method (FpSpread)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : GetCellRectangle Method
Index of the row of the viewport
Index of the column of the viewport
Row index of the cell
Column index of the cell
Gets the rectangle of the cell.
Syntax
'Declaration
 
Public Function GetCellRectangle( _
   ByVal rowViewportIndex As Integer, _
   ByVal columnViewportIndex As Integer, _
   ByVal row As Integer, _
   ByVal column As Integer _
) As Rectangle
'Usage
 
Dim instance As FpSpread
Dim rowViewportIndex As Integer
Dim columnViewportIndex As Integer
Dim row As Integer
Dim column As Integer
Dim value As Rectangle
 
value = instance.GetCellRectangle(rowViewportIndex, columnViewportIndex, row, column)
public Rectangle GetCellRectangle( 
   int rowViewportIndex,
   int columnViewportIndex,
   int row,
   int column
)

Parameters

rowViewportIndex
Index of the row of the viewport
columnViewportIndex
Index of the column of the viewport
row
Row index of the cell
column
Column index of the cell

Return Value

Rectangle object containing the size and location of the rectangle of the cell
Remarks

Use this method to identify the position of a cell relative to its location as it is viewed in the Spread component. For example, suppose you have a Spread that displays 10 rows at a time. Additionally, you are bound to a data source with 500 rows and during the course of operation the user has scrolled to a position that displays the 235th row. You can use this method to determine the exact pixel location of the 235th row relative to the top of the view window that is displaying the 10 rows out of the total 500 in the data source.

Example
This example returns the rectangle of the cell.
Rectangle r;
r = fpSpread1.GetCellRectangle(0, 0, 2, 2);
MessageBox.Show(r.Left.ToString());
Dim r As Rectangle

r = FpSpread1.GetCellRectangle(0, 0, 2, 2)

MessageBox.Show(r.Left.ToString())
See Also

Reference

FpSpread Class
FpSpread Members

User-Task Documentation

Getting Information of a Clicked Cell