DataGrid.UnSelect(Int32) 方法

定义

取消指定行的选定。

public:
 void UnSelect(int row);
public void UnSelect (int row);
member this.UnSelect : int -> unit
Public Sub UnSelect (row As Integer)

参数

row
Int32

要撤消选择的行的索引。

示例

下面的代码示例演示了此成员的使用。

   // On Click of Button "Unselect Row" this event is raised.
private:
   void UnselectRow_Clicked( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Unselect the current row from the Datagrid
      myDataGrid->UnSelect( myDataGrid->CurrentRowIndex );
   }

// On Click of Button "Unselect Row" this event is raised.
private void UnselectRow_Clicked(object sender, EventArgs e)
{
   // Unselect the current row from the Datagrid
   myDataGrid.UnSelect(myDataGrid.CurrentRowIndex);
}
' On Click of Button "Unselect Row" this event is raised.
 Private Sub UnselectRow_Clicked(ByVal sender As Object, ByVal e As EventArgs)
     ' Unselect the current row from the Datagrid
     myDataGrid.UnSelect(myDataGrid.CurrentRowIndex)
 End Sub

注解

将此方法与特定行的选择IsSelectedSelect状态一起使用,以及ResetSelection用于操作特定行的选择状态的方法。

适用于