프로그래밍/C#
datagridview rows 삭제 하는 방법
젤리씨
2017. 4. 26. 17:52
728x90
How to clear datagridview all rows
datagridview rows 삭제 하는 방법입니다
dataGridView1.Rows.Clear();
이렇게 하면 됩니다
하지만 컬럼명 하고 다 날아가 버리게 되죠
그냥 rows 만 삭제하고 싶을때
((DataTable)dataGridView1.DataSource).Rows.Clear();
이렇게 하면 컬럼명 하고 다 남아 있으며 rows만 삭제 됩니다.
728x90