jeffrey4u's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
29 (0.01 per day)
Joined:
11-February 09
Profile Views:
953
Last Active:
User is offline Oct 18 2015 11:04 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0

Latest Visitors

Icon   jeffrey4u has not set their status

Posts I've Made

  1. In Topic: Unsorted query

    Posted 12 Oct 2015

    i created additional numeric column and sorted based on that.
    thanks
  2. In Topic: Unsorted query

    Posted 12 Oct 2015

    thanks for your suggestion

    Let me try something out
  3. In Topic: Check for empty datagridview cells

    Posted 19 Feb 2014

    thank u very much for not given up on me.
    Your effort was very very helpful.

     Private Sub datViewFix_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles datViewFix.EditingControlShowing
            Dim txtBox As TextBox = CType(e.Control, TextBox)
            RemoveHandler txtBox.KeyPress, AddressOf txtKeyPress
            AddHandler txtBox.KeyPress, AddressOf txtKeyPress
            RemoveHandler txtBox.KeyDown, AddressOf TextBox_KeyDown
            AddHandler txtBox.KeyDown, AddressOf TextBox_KeyDown
        End Sub
    
    
        Private Sub txtKeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs)
        ' Check for delete or backspace AND your appropriate result to EmptyCount and Disable Button and exit the sub because this is enough to react to this event.    
    	If e.KeyChar = ControlChars.Back Then            
                If EmptyCount() = 0 Then 'Check empty count for the appropriate value that would cause enable
                    btnSave.Enabled = True
                Else
                    btnSave.Enabled = False
                End If
            Else
                If EmptyCount() <= 1 Then 'Check empty count for the appropriate value that would cause enable
                    btnSave.Enabled = True
                Else
                    btnSave.Enabled = False
                End If
            End If
        End Sub
    
    
        Private Sub TextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
            ' Check for delete or backspace AND your appropriate result to EmptyCount and Disable Button and exit the sub because this is enough to react to this event.
            If e.KeyCode = Keys.Delete Then
                If EmptyCount() = 0 Then 'Check empty count for the appropriate value that would cause enable
                    btnSave.Enabled = True
                Else
                    btnSave.Enabled = False
                End If
            End If
        End Sub
    
    
        Private Function EmptyCount() As Integer
            Dim Count As Integer = 0
            For Each r As DataGridViewRow In Me.datViewFix.Rows
                If r.Cells(1).Value Is Nothing OrElse r.Cells(1).Value.ToString = "" Then Count += 1
                If r.Cells(2).Value Is Nothing OrElse r.Cells(2).Value.ToString = "" Then Count += 1
            Next
            Return Count
        End Function
    


    It works just fine (though it has some little work around)
    Thank u again as i consider this post RESOLVED
  4. In Topic: Check for empty datagridview cells

    Posted 17 Feb 2014

    Still not getting it done
    i have attach a sample of the project (where am actually facing the problem)
    thank you
  5. In Topic: Check for empty datagridview cells

    Posted 15 Feb 2014

    see image

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

jeffrey4u hasn't added any friends yet.

Comments

jeffrey4u has no profile comments yet. Why not say hello?