Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi! I hope you can help me somehow, because I have a big, big problem...

 

I have a grid with some rows.

 

When I click a row my program must verify if there are some specific (important) details for the selected guest (row).

If there are, it must show the 'details window'.

When I double click a row it must do the same, but after closing the details window, must open the 'master window' of that guest.

 

When I make just one click, everything works fine, but when I make double click not so good :(

If there are no details the master window appears.

If there are details the 'details window' appears, but when I close it the other window doesn't appear.

 

Do you have any idea for what I need? Please..

Posted
The code is the following:
[size=1][font=Verdana]Private Sub gdxSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles gdxSearch.Click
     If (gdxSearch.HitTest = GridEX.GridArea.Cell) Then
        msSelectRow()
     End If
  End Sub
  Private Sub gdxSearch_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles gdxSearch.DoubleClick
     If (gdxSearch.HitTest = GridEX.GridArea.Cell) Then
        msSelectRow(True)
     End If
  End Sub

  Private Sub msSelectRow(Optional ByRef bolOpen As Boolean = False)
     On Error GoTo ShowError

     Dim gdrRow As GridEX.GridEXRow = gdxSearch.GetRow()
     Dim intId As Integer = CInt(gdrRow.Cells("GuestId").Value)
     Dim intType As Integer = CInt(gdrRow.Cells("GuestType").Value)

     Dim bolRefresh As Boolean = False

     ShowPopup(intId)

     If (bolOpen = True) Then
        Id = intId
        If (Id > 0) Then
           Select Case Mode
              Case Open.Sch
                 Dim f As frmUpdate
                 f = New frmUpdate

                 f.Id = Id
                 f.Type = intType
                 f.ShowDialog()
                 bolRefresh = f.Saved

                 f = Nothing
              Case Open.Sel
                 Me.Close()
           End Select
        End If
     End If

     If (bolRefresh = True) Then
        intStartAt = 0
        msRefreshGrid(Direc.Front)
     End If

     Exit Sub
ShowError:
     InfoError(Err.Number, Err.Description)
     Exit Sub
  End Sub

  Public Sub ShowPopup(ByVal intId As Integer)
     On Error GoTo ShowError

     Dim bolShow As Boolean = DbParameterGet(PIPopupShow, PVPopupShow, PTBol, PDPopupShow)
     Dim bolExists As Boolean = DbPopupExists(intId)
     Dim strShow As String = GetSetting(SetApp, SetSec(intId), SetKeyDate, DateString)
     Dim dtmShow As Date = CDate(strShow)
     Dim bolDate As Boolean = (dtmShow < DbHotelDate())

     If ((bolShow = True) And (bolExists = True) And (bolDate = True)) Then
        Dim f As frmPopup
        f = New frmPopup

        f.Id = intId
        f.ShowDialog()

        f = Nothing
     End If

     Exit Sub
ShowError:
     InfoError(Err.Number, Err.Description)
     Exit Sub
  End Sub[/font][/size]

  • *Experts*
Posted
Is the double click behaving the same as the click. I ask this because I once had the same problem and ended up using the SelectedIndexChanged sub instead of the Click sub to solve the problem.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted
Have you tried putting breakpoints in the Click and DoubleClick event handlers and seeing what exactly is being called when you double click?

Yes.. Let me try to explain what happens...

 

If I have no breakpoints:

- If I doubleclick and there are no details to show it shows the main windows as supposed to (and also a message just to indicate that it was a double click)

- But, if I double click and there are details to show it shows the detail window, but doesn't show the message box and the main window :(

 

If I have break points:

- It always work as if it was a single click

 

It seems to me that showing the detail window is 'disabling' the double click for some reason :(

Posted
Is the double click behaving the same as the click. I ask this because I once had the same problem and ended up using the SelectedIndexChanged sub instead of the Click sub to solve the problem.

My only problem using SelectedIndexChanged (or stg like that) is that I don't wanna show the detail window if the user is navigating in the grid with the keybord.

But... If I can find a way to know if it was a click or a keypress........ It would be great!! Does the 'sender' object gave me that?

Sorry, but I'm not to familiarized with the newm objects of vb.net :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...