C# 2008 SP1입니다.C# 바인딩 소스로 묶인 입력 된 데이터 집합에서 행을 삭제하는 가장 좋은 방법은
DataGridview에서 현재 선택된 행에서 행을 삭제합니다.
저는 Typed 데이터 집합을 사용하고 있으며 내 datagridview는 바인딩 소스에 바인딩되어 있습니다.
그러나 내 기술은 효과가 있다고하더라도 최상의 것은 아니라고 생각합니다. 어떤 조언을
많은 감사,
DataRow[] drDelete;
// Get the value of the PK from the currently selected row
DataRowView drv = (DataRowView)bsAddressBook.Current;
int index = Convert.ToInt16(drv[0]);
// Find the actual data row from the primary key and delete the row
drDelete = dsCATDialer.AddressBook.Select(string.Format("ID = '{0}'", index));
dsCATDialer.AddressBook.Rows.Remove(drDelete[0]);