DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: DataGrid and Double-Click Event

  1. #1
    brett Guest

    DataGrid and Double-Click Event


    I have two data grids on a form. One of the datagrids will fire the double-click
    event, the other grid will not.

    I looked in the docs and found that to have a double-click event and found
    this "The ControlStyles.StandardClick style must be set for this event to
    be raised".

    The one working grid had a "click" event defined, so I defined a "click"
    event for the second grid, still no double-click.

    Any idea?

    Thanks

    Brett

  2. #2
    VBDotNet Team [MS] Guest

    Re: DataGrid and Double-Click Event

    Hooking up a "DoubleClick" event handler to the standard DataGrid control on
    a WinForm seems to raise the event appropriately without any problems. This
    was even without setting the ControlStyles.StandardClick style on the
    control. To be precise, what we tried was inserting a DataGrid on a
    WinForm, and added the DoubleClick event through the VB dropdowns, and added
    some test code to verify that the DoubleClick event does get fired.

    Please clarify your problem, and see if you could simplify the scenario.

    Hope this helps
    Pan & Ibrahim
    Microsoft VisualBasic .NET Team

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    "brett" <bvandyke@ems.jsc.nasa.gov> wrote in message
    news:3d19db43$1@10.1.10.29...
    >
    > I have two data grids on a form. One of the datagrids will fire the

    double-click
    > event, the other grid will not.
    >
    > I looked in the docs and found that to have a double-click event and found
    > this "The ControlStyles.StandardClick style must be set for this event to
    > be raised".
    >
    > The one working grid had a "click" event defined, so I defined a "click"
    > event for the second grid, still no double-click.
    >
    > Any idea?
    >
    > Thanks
    >
    > Brett




  3. #3
    brett Guest

    Re: DataGrid and Double-Click Event


    I did the same thing, added the doubleclick event through the vb dropdowns
    - it works fine on one of the datagrids but will not fire on the other datagrid.
    I removed the code for it and re-did it completely, it still does not fire.

    This is the def for the one that works:
    'dgPlayList
    '
    Me.dgPlayList.AllowNavigation = False
    Me.dgPlayList.CaptionText = "Play Lists:"
    Me.dgPlayList.DataMember = "PlayList"
    Me.dgPlayList.DataSource = Me.DsPlayLists1
    Me.dgPlayList.HeaderForeColor = System.Drawing.SystemColors.ControlText
    Me.dgPlayList.Location = New System.Drawing.Point(432, 8)
    Me.dgPlayList.Name = "dgPlayList"
    Me.dgPlayList.RowHeadersVisible = False
    Me.dgPlayList.Size = New System.Drawing.Size(576, 136)
    Me.dgPlayList.TabIndex = 41
    Me.dgPlayList.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle()
    {Me.DGTSPlayList})

    This is the def for the one that doesn't work:
    'dgFileInfo
    '
    Me.dgFileInfo.AllowDrop = True
    Me.dgFileInfo.CaptionText = "Current Play List:"
    Me.dgFileInfo.DataMember = "PlayList.PlayListFileInfo"
    Me.dgFileInfo.DataSource = Me.DsPlayLists1
    Me.dgFileInfo.HeaderForeColor = System.Drawing.SystemColors.ControlText
    Me.dgFileInfo.Location = New System.Drawing.Point(432, 144)
    Me.dgFileInfo.Name = "dgFileInfo"
    Me.dgFileInfo.Size = New System.Drawing.Size(576, 184)
    Me.dgFileInfo.TabIndex = 42
    Me.dgFileInfo.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle()
    {Me.DataGridTableStyle1})

    Any more ideas?

    Thanks

    "VBDotNet Team [MS]" <vbdotnet@microsoft.com> wrote:
    >Hooking up a "DoubleClick" event handler to the standard DataGrid control

    on
    >a WinForm seems to raise the event appropriately without any problems.

    This
    >was even without setting the ControlStyles.StandardClick style on the
    >control. To be precise, what we tried was inserting a DataGrid on a
    >WinForm, and added the DoubleClick event through the VB dropdowns, and added
    >some test code to verify that the DoubleClick event does get fired.
    >
    >Please clarify your problem, and see if you could simplify the scenario.
    >
    >Hope this helps
    >Pan & Ibrahim
    >Microsoft VisualBasic .NET Team
    >
    >--
    >This posting is provided "AS IS" with no warranties, and confers no rights.
    >"brett" <bvandyke@ems.jsc.nasa.gov> wrote in message
    >news:3d19db43$1@10.1.10.29...
    >>
    >> I have two data grids on a form. One of the datagrids will fire the

    >double-click
    >> event, the other grid will not.
    >>
    >> I looked in the docs and found that to have a double-click event and found
    >> this "The ControlStyles.StandardClick style must be set for this event

    to
    >> be raised".
    >>
    >> The one working grid had a "click" event defined, so I defined a "click"
    >> event for the second grid, still no double-click.
    >>
    >> Any idea?
    >>
    >> Thanks
    >>
    >> Brett

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center