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

Make CurrentCellKeyPress event visible under the custom control

Thread ID:

Created:

Updated:

Platform:

Replies:

16423 Jul 15,2004 06:33 AM Jul 15,2004 10:30 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 15, 2004 06:33 AM

Hi, I created a custom control that has a GridDataBoundGrid and a Button. How can I expose the GDBG''s CurrentCellKeyPress event on the custom control''s properties page so that I can add code to the CurrentCelKeyPress event? Thanks in advance.

Administrator [Syncfusion]
Replied On July 15, 2004 08:56 AM

One way I think you can do this is to: 1) add a new public event to your usercontrol public event KeyPressEventHandler GridCellKeyPress; 2) in your UserControl.Load, subscribe to the grid''s event. this.gridDataBoundGrid1.CurrentCellKeyPress += new KeyPressEventHandler(gridDataBoundGrid1_CurrentCellKeyPress); 3) In your handler in the UserControl, raise your new public event.
private void gridDataBoundGrid1_CurrentCellKeyPress(object sender, KeyPressEventArgs e)
{
	if(GridCellKeyPress != null)
		GridCellKeyPress(sender, e);
}

Administrator [Syncfusion]
Replied On July 15, 2004 10:30 AM

Thanks >One way I think you can do this is to: > >1) add a new public event to your usercontrol > > public event KeyPressEventHandler GridCellKeyPress; > > >2) in your UserControl.Load, subscribe to the grid''s event. > >this.gridDataBoundGrid1.CurrentCellKeyPress += new KeyPressEventHandler(gridDataBoundGrid1_CurrentCellKeyPress); > > >3) In your handler in the UserControl, raise your new public event. >
>private void gridDataBoundGrid1_CurrentCellKeyPress(object sender, KeyPressEventArgs e)
>{
>	if(GridCellKeyPress != null)
>		GridCellKeyPress(sender, e);
>}
>

CONFIRMATION

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.

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.

;