본문 바로가기

VB.net/DataGridView15

DatagridView 이벤트 Numbers, Backspace & Delete 키 전용 VB.Net을 허용하려면 Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing Select Case DataGridView1.CurrentCell.ColumnIndex Case Is = 0, 1 AddHandler CType(e.Control, TextBox).KeyPress, AddressOf TextBox_keyPress End Select End Sub Private Sub TextBox_keyPress(ByVal sender As Obj.. 2018. 11. 9.
데이터그리드뷰 복사하기 'References to source and target grid. Dim sourceGrid As DataGridView = Me.DataGridView1 Dim targetGrid As DataGridView = Me.DataGridView2 'Copy all rows and cells. Dim targetRows = New List(Of DataGridViewRow) For Each sourceRow As DataGridViewRow In sourceGrid.Rows If (Not sourceRow.IsNewRow) Then Dim targetRow = CType(sourceRow.Clone(), DataGridViewRow) 'The Clone method do not copy the cell .. 2018. 10. 22.
데이터 그리드뷰 셀에 숫자만 입력되게 하기 Private Sub TextBox_keyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) If Char.IsDigit(CChar(CStr(e.KeyChar))) = False Then e.Handled = True End Sub Private Sub TextBox_keyPress1(ByVal sender As Object, ByVal e As KeyPressEventArgs) If Not (Char.IsDigit(CChar(CStr(e.KeyChar))) Or e.KeyChar = ".") Then e.Handled = True End Sub Private Sub Guide_DGV_EditingControlShowing(sender As Obje.. 2018. 10. 12.
datagridview에서 선택한 Row의 Cell 값 가져오기 DataGridView1.Rows(e.RowIndex).Cells(0).Value 2018. 5. 9.