NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataGrid.SelectedIndex

Gets or sets index of the selected row.

[Visual Basic]
Public Property SelectedIndex As Integer
[C#]
public int SelectedIndex {get; set;}
[C++]
public: __property int get_SelectedIndex();
public: __property void set_SelectedIndex(int);
[JScript]
public function get SelectedIndex() : int;
public function set SelectedIndex(int);

Property Value

The zero-based index of the selected row.

Exceptions

Exception Type Condition
Exception There is no ListManager.

Remarks

The SelectedIndex property allows you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the SelectedIndex will cause the DataGrid to display the next set of records in the child table that are linked to the parent table.

Example [Visual Basic]

The following example increments the SelectedIndex by 1.

[Visual Basic]

' Undone: check to make sure the index isn't at the end.
DataGrid1.SelectedIndex += 1

See Also

DataGrid Class | DataGrid Members | System.WinForms Namespace