티스토리 뷰

현재 선택되어 있는 Data Grid View의 cell 값


this.DGV1.Rows[ this.DGV1.CurrentCellAddress.Y ].Cells[0].Value.ToString()

this.DGV1.Rows[ this.DGV1.CurrentCellAddress.Y ].Cells[1].Value.ToString()

this.DGV1.Rows[ this.DGV1.CurrentCellAddress.Y ].Cells[2].Value.ToString()

...


와 같이 쓰이며 



위와 같이 DataGridview 에서 항목을 클릭했을 때 cell값을 뽑아 낼 수 있다.


왼쪽의 번호는 No 를 지정한 것이고, Cell[1] 의 값을 뽑았기에 터키 키리칼의 값이 뽑아져 나왔다.


MessageBox 를 이용해서 출력했고.


짧게 하나 더 붙이자면




위와 같이 MessageBox.show() 를 이용해서 처리.



MessageBox에 관한 글을 다음 글에서 하겠음.

댓글
댓글쓰기 폼