728x90
엑셀처럼 셀을 클릭하면 해당 셀을 상단의 공간에 보여주기 위한 용도로 활용해봤다.
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
lbl_View.Text = this.dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();
}
// MouseDown 이벤트 : 마우스 포인터가 컨트롤 위에 있을 때 마우스 단추를 클릭하면 발생
private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
{
lbl_View1.Text = this.dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();
}
// MouseClick 이벤트 : 컨트롤을 마우스로 클릭할 때 발생
728x90
'C# > dataGridView' 카테고리의 다른 글
C# dataGridView 행 삭제 (0) | 2015.10.05 |
---|---|
C# dataGridView 현재 Row의 셀값 읽어내기 (KeyUp), CurrentCell (0) | 2015.09.21 |
C# dataGridView 자동 번호 매기기( 원하는 칼럼에 ) (0) | 2015.09.04 |
C# dataGridView 선택된 셀 내용 Textbox 에 표시하기 (0) | 2015.09.04 |
C# dataGridView 기능 분석 (0) | 2015.09.03 |