FlexGrid for WinForms | ComponentOne
C1.Win.C1FlexGrid Namespace / C1FlexGridBase Class / TopRow Property

In This Topic
    TopRow Property (C1FlexGridBase)
    In This Topic
    Gets or sets the first visible row in the scrollable area.
    Public Property TopRow As Integer
    public int TopRow {get; set;}

    Setting the TopRow property causes the grid to scroll vertically so that the given row becomes the topmost visible row. This is often useful when you want to synchronize two or more grids so that when one of them scrolls, the other scrolls as well. To scroll horizontally, use the LeftCol property.

    When setting this property, the largest possible row number is the total number of rows minus the number of rows that will fit the display. Attempting to set TopRow to a greater value will cause the grid to set it to the largest possible value (no error will occur).

    The value returned by the LeftCol and TopRow properties may correspond to partially visible rows or columns.

    Use the LeftCol and TopRow properties to scroll using cells as units. Use the C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.ScrollPosition property to scroll the grid using pixel units.

    To ensure that a given cell is visible, use the ShowCell method.

    See Also