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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Passing events to Form via user control

Thread ID:





1290 Oct 11,2002 09:00 PM UTC Oct 14,2002 12:53 PM UTC WinForms 2
Tags: GridControl
Rollan Mosko
Asked On October 11, 2002 09:00 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Rollan Mosko
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon