Skip to content

Eventhandler for Dynamic Controls

rathi rathi

Asked May 26, 2006, 2:36 AM EDT1 answer
Share
LinkedInX
I have linkbuttons in my dynamic datagrid. On click of the linkbuttons I have to get the value of the adjacent column. As this is dynamic datagrid I have to use delegates and EventHandlers for this Provide me a sample for this . I am not able to work with the system created Events. Try to help me how to handle this. byeeeeeeeeee thank you

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    hi rathi,

    when u r creating the controls dynamically,take care that you assign  the name or id property of the control.

    when u assign the name of the control ,also add handler to it there itself.

    later you can define it as per your requirements.

    look at the sample for reference:

    the place where you add the link to datagrid,add the handler like this:

    TypeScript
    linkButton1.LinkCliked+=new LinkButtonLinkClickedEventArgs(linkButton1.Clicked)
    private void linkButton1_LinkClicked(object sender, System.Windows.Forms.LinkButtonLinkClickedEventArgs e)
    {
    //code here for the event.....
    
    
    }
    0