Home All Groups Group Topic Archive Search About

Datagrid Plus Sign Event

Author
12 Jan 2006 3:49 PM
blue_nirvana
Is there an event that fires when a user clicks the plus sign in a
Master/Detail datagrid?  It would be even better if I could catch when the
user clicks the link to see the detail records.  What I'm wanting to do is
not load the detail data until the user clicks the link.  Any ideas or links
would be appreciated.

Thanks

Author
12 Jan 2006 9:14 PM
Ken Tucker [MVP]
Hi,

        I dont think there is any event that fires when you click on the
plus sign for the child records.  You can check and see in the mouse down
event if the user clicked on the row header but that does not necessarly
mean they clicked the +

    Private Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown
        Dim hti As DataGrid.HitTestInfo
        hti = DataGrid1.HitTest(e.X, e.Y)
        Trace.WriteLine(hti.Type)
    End Sub

The navigate event fires when you switch between parent and child records.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridclassnavigatetopic.asp

Ken
----------------------
Show quoteHide quote
"blue_nirvana" <bluenirv***@discussions.microsoft.com> wrote in message
news:97A84C04-0879-4580-B862-3DB4495CC8CB@microsoft.com...
> Is there an event that fires when a user clicks the plus sign in a
> Master/Detail datagrid?  It would be even better if I could catch when the
> user clicks the link to see the detail records.  What I'm wanting to do is
> not load the detail data until the user clicks the link.  Any ideas or
> links
> would be appreciated.
>
> Thanks
Author
20 Jan 2006 12:26 AM
blue_nirvana
Thanks Ken, but I just went ahead and added another datagrid and switch
between the parent and child based on the user clicking a link label type
column.

Thanks for your response.

Show quoteHide quote
"Ken Tucker [MVP]" wrote:

> Hi,
>
>         I dont think there is any event that fires when you click on the
> plus sign for the child records.  You can check and see in the mouse down
> event if the user clicked on the row header but that does not necessarly
> mean they clicked the +
>
>     Private Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As
> System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown
>         Dim hti As DataGrid.HitTestInfo
>         hti = DataGrid1.HitTest(e.X, e.Y)
>         Trace.WriteLine(hti.Type)
>     End Sub
>
> The navigate event fires when you switch between parent and child records.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridclassnavigatetopic.asp
>
> Ken
> ----------------------
> "blue_nirvana" <bluenirv***@discussions.microsoft.com> wrote in message
> news:97A84C04-0879-4580-B862-3DB4495CC8CB@microsoft.com...
> > Is there an event that fires when a user clicks the plus sign in a
> > Master/Detail datagrid?  It would be even better if I could catch when the
> > user clicks the link to see the detail records.  What I'm wanting to do is
> > not load the detail data until the user clicks the link.  Any ideas or
> > links
> > would be appreciated.
> >
> > Thanks
>
>
>