GridView.MakeRowVisible(Int32, Boolean) Method
Makes the specified row visible on screen. Allows you to invalidate the row, if required.
public void MakeRowVisible( int rowHandle, bool invalidate )
Public Sub MakeRowVisible( rowHandle As Integer, invalidate As Boolean )
An integer value specifying the handle of the row that should be made visible.
true if the row needs to be invalidated; otherwise, false.
The MakeRowVisible method's functionality depends on the current visibility of the specified row. So, the following three cases can occur:
- If the specified row is completely visible on screen, the method does nothing.
- If the row is partially visible, the method scrolls the minimum number of rows required to make the row completely visible. Note that rows can be partially visible only when they are at the bottom of the View. Thus, as a result, the View is scrolled down and the row is located near the View's bottom edge.
- If the row is not visible on screen, the View scrolls vertically and expands group rows containing the hidden row (if required). Note that in this case, the MakeRowVisible method attempts to make the specified row the top visible row.
Note: when focusing a row using the ColumnView.FocusedRowHandle property, the View automatically makes the specified row visible on screen. The MakeRowVisible method is used for this purpose. So, you don't have to use the MakeRowVisible method if you need to focus the target row. Simply assign the desired row handle to the ColumnView.FocusedRowHandle property.
Calling the MakeRowVisible method before a grid control is completely initialized will have no effect. Before calling this method on loading the form, call the GridControl.ForceInitialize method. See this method to learn more.
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the MakeRowVisible member must not be invoked for these Views. The MakeRowVisible 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.
- GridControl.MainView - returns the top most View in a grid;
- GridControl.FocusedView - returns the focused View;
- GridControl.DefaultView - returns the currently maximized View;
- the sender parameter of View specific events;
- GridView.GetDetailView - returns a detail clone View for a specific master row.