We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Passing events to Form via user control

I made a user control containing a gridcontrol that I added handlers for nicely growing the right-most column and other stuff. My problem is that I want to pass events (like CellDoubleClick) to the parent form so the form can decide what to do. What do I have to do to my user control to make this happen? I made the grid control public, but I can't add the ..CellDoubleClick event handler in the parent form code (it thinks the grid control wasn't defined with 'With Events'. I made this member public and it does have with events in the definition so I'm unclear what the problem is. I attached code in case there's any questions. thanks a bunch, Rollan

2 Replies

AD Administrator Syncfusion Team October 12, 2002 06:49 AM UTC

Have you tried explicitly adding the handler by calling AddHandler? 'maybe in your OnLoad override, add AddHandler ctlGrid.grdInfo.CellDoubleClick, AddressOf HandleDClick '... Private Sub HandleDClick(ByVal sender as Object, ByVal e as GridCellClickEventArgs) 'do whatever.... End Sub


RM Rollan Mosko October 14, 2002 12:53 PM UTC

Hi Clay, That does the trick. I haven't had to add any handlers manually until now. I'll use this technique when I have similar problems in the future. thanks again, Rollan

Loader.
Up arrow icon