C#으로 개발을 하다 보면은 datagridview를 사용할 일이 너무 많아서 한번 기록을 해두기 위해서 글을 작성합니다. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle1.Font = new System.Drawing.Font("맑은 고딕", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(165))); dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; //줄바꿈 this.dataGridViewFileList.Columns.Clear(); this.dataGridViewFileList.Rows.Clear(); this.dataGridViewFileList.Refresh(); this.dataGridViewFileList.BorderStyle = BorderStyle.None; this.dataGridViewFileList.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.None; this.dataGridViewFileList.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None; this.dataGridViewFileList.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal; this.dataGridViewFileList.BackgroundColor = Color.White; this.dataGridViewFileList.DefaultCellStyle.SelectionBackColor = Color.FromArgb(0, 161, 218);//선택시 this.dataGridViewFileList.DefaultCellStyle.SelectionForeColor = Color.White; //선택시 this.dataGridViewFileList.AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue;//Color.FromArgb(236, 240, 241); this.dataGridViewFileList.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(228, 170, 102); this.dataGridViewFileList.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.dataGridViewFileList.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.dataGridViewFileList.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None; this.dataGridViewFileList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; this.dataGridViewFileList.DefaultCellStyle.WrapMode = DataGridViewTriState.True; //줄바꿈 this.dataGridViewFileList.Font = new System.Drawing.Font("맑은 고딕", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(165))); this.dataGridViewFileList.Visible = true; this.dataGridViewFileList.ReadOnly = true; this.dataGridViewFileList.MultiSelect = false; this.dataGridViewFileList.AutoGenerateColumns = false; this.dataGridViewFileList.RowHeadersVisible = false; this.dataGridViewFileList.ShowCellErrors = false; this.dataGridViewFileList.ShowCellToolTips = false; this.dataGridViewFileList.ShowEditingIcon = false; this.dataGridViewFileList.ShowRowErrors…