Make CurrentCellKeyPress event visible under the custom control

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.

2 Replies

AD Administrator Syncfusion Team July 15, 2004 12:56 PM UTC

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);
}


AD Administrator Syncfusion Team July 15, 2004 02:30 PM UTC

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);
>}
>

Loader.
Up arrow icon