?
Solved

DATAGRIDVIEW VISIBLE = FALSE PROBLEM

Posted on 2014-10-16
4
Medium Priority
?
142 Views
Last Modified: 2014-10-17
Hi Experts

in my  textbox1  presskey i have the following code

      If e.KeyChar <> "" Then

            Dim dv As New DataView
            Dim regicx As String = ""
            If e.KeyChar < "A" Or e.KeyChar > "z" And e.KeyChar <> ControlChars.Back Then
                If Microsoft.VisualBasic.Len(codeBox.Text.Trim) > 0 Then
                    regicx = Microsoft.VisualBasic.Left(codeBox.Text, Microsoft.VisualBasic.Len(codeBox.Text.Trim) - 1)
                End If
            Else
                regicx = codeBox.Text.Trim + e.KeyChar.ToString
            End If
            Dim reglenx = Microsoft.VisualBasic.Len(regicx)
            dv = New DataView(dtCustFull, "Substring(ccode, 1, " & reglenx & ")= '" & regicx & "'", "", DataViewRowState.CurrentRows)
            DataGridView2.DataSource = dv
            DataGridView2.Visible = True
        Else
            DataGridView2.Visible = False
        End If

and then textbox1 keydown
  DataGridView2.Visible = False

But   DataGridView2 is still visible

I have even tried in the next textbox.gotfocus
  DataGridView2.Visible = False

still same problem

I tried this code in myform.click
  DataGridView2.Visible = False

and when I click on my form it disappears.

Please help
0
Comment
Question by:b001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40384931
If e.KeyChar <> "" Then
    Else
            DataGridView2.Visible = False
        End If

Considering it's a keyPress I don't think e.KeyChar will ever be blank.

Did you confirm the textbox.GotFocus actually fires?

Try the Enter Event.
0
 

Author Comment

by:b001
ID: 40384963
The nextbox when gotfocus

I put  to check if it gets the focus. it does, but it stays in the loop for a while.
 msgbox("Y")
 DataGridView2.Visible = False
0
 

Author Comment

by:b001
ID: 40384975
When Enter Event occurs?
0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 40385210
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question