DataGrid.IsExpanded(Int32) 메서드

정의

지정된 행의 노드가 확장되는지 아니면 축소되는지를 나타내는 값을 가져옵니다.Gets a value that indicates whether the node of a specified row is expanded or collapsed.

public:
 bool IsExpanded(int rowNumber);
public bool IsExpanded (int rowNumber);
member this.IsExpanded : int -> bool
Public Function IsExpanded (rowNumber As Integer) As Boolean

매개 변수

rowNumber
Int32

해당 행 번호입니다.The number of the row in question.

반환

Boolean

노드가 확장되면 true이고, 그렇지 않으면 false입니다.true if the node is expanded; otherwise, false.

예제

다음 코드 예제에서는 표의 각 행을 테스트 하 고 확장 된 행의 행 수를 인쇄 합니다.The following code example tests each row in the grid, and prints the row number of expanded rows.

protected:
   void TextExpanded( DataGrid^ myGrid )
   {
      // Get the DataTable of the grid
      DataTable^ myTable;
      // Assuming the grid is bound to a DataTable
      myTable = (DataTable^)(myGrid->DataSource);
      for ( int i = 0; i < myTable->Rows->Count; i++ )
      {
         if ( myGrid->IsExpanded( i ) )
         {
            Console::WriteLine( "Row {0} was expanded", i );
         }
      }
   }
protected void TextExpanded(DataGrid myGrid){
    // Get the DataTable of the grid
    DataTable myTable;
    // Assuming the grid is bound to a DataTable
    myTable = (DataTable) myGrid.DataSource;
    for(int i = 0;i < myTable.Rows.Count ;i++) {
       if(myGrid.IsExpanded(i)) {
          Console.WriteLine("Row " + i + " was expanded");
       }
    }
 }
    
Protected Sub TextExpanded(myGrid As DataGrid)
    ' Get the DataTable of the grid
    Dim myTable As DataTable
    ' Assuming the grid is bound to a DataTable
    myTable = CType(myGrid.DataSource, DataTable)
    Dim i As Integer
    For i = 0 To myTable.Rows.Count - 1
        If myGrid.IsExpanded(i) Then
            Console.WriteLine(("Row " & i & " was expanded"))
        End If
    Next i
End Sub

적용 대상

추가 정보