共用方式為


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

備註

使用這個方法搭配 IsSelectedSelectResetSelection 方法來操作特定資料列的選取狀態。

適用於