ColumnView.MoveLast() Method

Moves focus to the last data record.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public virtual void MoveLast()
Public Overridable Sub MoveLast

Remarks

If the last data record (row or card) is invisible on screen, calling the MoveLast method scrolls the View to make the record visible. Note that in Grid Views, the last data row may be hidden within a collapsed group. In such cases, necessary groups are expanded to make the row visible.

End-users can focus the last data record by pressing the "Last" button of the embedded data navigator or pressing CTRL+END while the View has focus.

If you need to move focus to the last visible row (row, group row, or card), use the ColumnView.MoveLastVisible method.

In Instant Feedback Mode, the MoveLast method when called, does nothing while a grid is loading its data for the first time. If you need to move focus to the last record on the grid's initialization, handle the ColumnView.RowLoaded event as follows:


using DevExpress.XtraGrid.Views.Base;

bool needMoveLastRow = true;
private void gridView1_RowLoaded(object sender, RowEventArgs e) {
    ColumnView view = sender as ColumnView;
    if (needMoveLastRow) {
        needMoveLastRow = false;
        view.MoveLast();
    }
}
NOTE

Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the MoveLast member must not be invoked for these Views. The MoveLast member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

See Also