DataTable dt = dataGrid1.DataSource as DataTable;
dt.Rows.RemoveAt(dataGrid1.CurrentRowIndex);
dt.AcceptChanges();
dataGrid1.DataSource = dt;
if (dt.Rows.Count > 0)
{
dataGrid1.CurrentRowIndex = 0;
dataGrid1.Select(dataGrid1.CurrentRowIndex);
}
'C#' 카테고리의 다른 글
SATO Barcode Command(SBPL) (0) | 2016.03.24 |
---|---|
[C#]DataTable Sort 예제 (0) | 2016.03.23 |
[C#]문자열을 16진수로 변환 예제 (0) | 2016.03.22 |
[C#]배열에서 오름차순, 내림차순 예제 (0) | 2016.03.21 |
[C#]요일 구하기 예제 (0) | 2016.03.15 |