CurrencyManager.RemoveAt(Int32) 메서드

정의

지정된 인덱스에서 항목을 제거합니다.

public:
 override void RemoveAt(int index);
public override void RemoveAt (int index);
override this.RemoveAt : int -> unit
Public Overrides Sub RemoveAt (index As Integer)

매개 변수

index
Int32

목록에서 제거할 항목의 인덱스입니다.

예외

지정된 index에 행이 없는 경우

예제

다음 코드 예제에서는 이 메서드를 RemoveAt 사용하여 목록의 위치 0에 있는 항목을 제거합니다.

void RemoveFromList()
{
   
   // Get the CurrencyManager of a TextBox control.
   CurrencyManager^ myCurrencyManager = dynamic_cast<CurrencyManager^>(textBox1->BindingContext[nullptr]);
   
   // If the count is 0, exit the function.
   if ( myCurrencyManager->Count > 1 )
         myCurrencyManager->RemoveAt( 0 );
}
private void RemoveFromList(){
    // Get the CurrencyManager of a TextBox control.
    CurrencyManager myCurrencyManager = (CurrencyManager)textBox1.BindingContext[0];
    // If the count is 0, exit the function.
    if(myCurrencyManager.Count > 1)
    myCurrencyManager.RemoveAt(0);
}
Private Sub RemoveFromList()
    ' Get the CurrencyManager of a TextBox control.
    Dim myCurrencyManager As CurrencyManager = CType(textBox1.BindingContext(0), CurrencyManager)
    ' If the count is 0, exit the function.
    If myCurrencyManager.Count > 1 Then
        myCurrencyManager.RemoveAt(0)
    End If
    
End Sub

설명

이 메서드는 RemoveAt 컨트롤과 같은 복잡한 컨트롤이 DataGrid 목록에서 항목을 제거할 수 있도록 설계되었습니다. 이 메서드를 사용하여 실제로 항목을 제거하면 안 됩니다. 대신 클래스의 메서드를 Delete DataView 사용하여 항목을 삭제합니다.

적용 대상

추가 정보