일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- 메이플
- 모바일 게임
- C#
- 나워
- 일상
- 프메추천
- 오로라
- 메이플 나워
- 메이플스토리 나워
- 메이플스토리
- 메이플5차
- 신생서버
- 묘용
- 스라벨
- 메이플스토리 나이트워커
- 마라벨
- 프리메이플
- 티스토리
- mssql
- 여름 휴가 계획
- 메이플 나이트워커
- DateTime
- dataGridView
- 나이트워커
- 프메
- c-sharp
- 메이플스토리 오로라
- SQL Server
- 여름 휴가
- 메이플 오로라
- Today
- 57
- Total
- 295,768
목록dataGridView (4)
Jasmin Time
// 편집 불가능(읽기) dataGridView1.ReadOnly = true; // 편집 가능(읽기, 쓰기) dataGridView1.ReadOnly = false; // 추가 O dataGridView1.AllowUserToAddRows = true; // 추가 X dataGridView1.AllowUserToAddRows = false; // 삭제 O dataGridView1.AllowUserToDeleteRows = true; // 삭제 X dataGridView1.AllowUserToDeleteRows = false; // 열 다시 정렬 O dataGridView1.AllowUserToOrderColumns = true; // 열 다시 정렬 X dataGridView1.AllowUserToOrd..
private void Save_Csv(string fileName, DataGridView dgv, bool header) { string delimiter = "`"; // 구분자 FileStream fs = new FileStream(fileName, System.IO.FileMode.Create, System.IO.FileAccess.Write); StreamWriter csvExport = new StreamWriter(fs, System.Text.Encoding.UTF8); if (dgv.Rows.Count == 0) return; // 헤더정보 출력 if (header) { for (int i = 0; i
데이터그리드뷰의 모든 열을 선택할 때는 dataGridView1.SelectAll(); 그 선택을 해제할 때는dataGridView1.ClearSelection(); 의 메소드를 사용한다.
엑셀 라이브러리 참조없이 OleDb를 이용한 방법으로 DataGridView의 데이터를 엑셀로 출력하는 방법이다.이때, 엑셀파일을 File 을 이용해 생성하면 제대로 생성되지 않아 사용할 없다.따라서 소스를 보면 알겠지만 엑셀파일 하나를 복사해서 거기에 데이터를 저장하는 편법을 이용했다. OleDbConnection conn = null; try { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Excel File(.xls)|*.xls"; if (sfd.ShowDialog() == DialogResult.OK) { FileInfo fi = new FileInfo(sfd.FileName); if (!fi.Exists) { File.Copy(Applic..