UIKit.UITableView.SelectRow Method
Selects the given row, optionall scrolling the row to a specific location.

Syntax

[Foundation.Export("selectRowAtIndexPath:animated:scrollPosition:")]
public virtual void SelectRow (Foundation.NSIndexPath indexPath, bool animated, UITableViewScrollPosition scrollPosition)

Parameters

indexPath
Identifies the row to be selected.
animated
true to animate the selection and position change, false if the change should occur immediately.
scrollPosition
Position that the selected row should be scrolled to (top, middle, bottom).

Remarks

Example

Passing UITableViewScrollPosition.None. will result in no scrolling (despite that constant normally causing minimal scrolling). To scroll to the newly selected row with minimum scrolling, select the row using this method with UITableViewScrollPosition.None then call UITableView.ScrollToRow(Foundation.NSIndexPath, UITableViewScrollPosition, bool) also with UITableViewScrollPosition.None.

C# Example

              NSIndexPath rowToSelect; // assume this is valid
              UITableView myTableView; // assume this is valid
              
              myTableView.SelectRow (rowToSelect, true, UITableViewScrollPosition.None);
              myTableView.ScrollToRow (rowToSelect, UITableViewScrollPosition.None, true);
            

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0