Lalit Bhatia said:
I am creating a Usercontrol, In my user control I have one datagrid.
I want if user double clicks on datagrid, then double click of user
control
fire.
how can we implement this?
any suggestions?
Have you created the event for your user control? In that event handler, you
need to raise the event for your datagrid.
What follows is VB-like pseudocode, but it illustrates the principle:
----IN THE USERCONTROL CLASS (pseudo-code)
Public Event CtlClick(ByVal sender As Object, ByVal e As
System.EventArgs)
Private Sub UserControl_Click(ByVal sender As System.Object, ...
RaiseEvent CtlClick(Me, New System.EventArgs)
End Sub
Private Sub {labelname}_Click (ByVal sender As System.Object, ...
RaiseEvent CtlClick(Me, New System.EventArgs)
End Sub
----IN THE FORM/CLASS THAT CONSUMES USERCONTROL (pseudo-code)
Private Sub UserControl1_CtlClick (ByVal sender As Object, ByVal e As
_
System.EventArgs) Handles UserControl1.Click
'Code to handle CtlClick event
End Sub
Sorry, couldn't find a C# code example this morning.