Eventhandler for Dynamic Controls
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.
pranahetha3 pointsPosted May 29, 2006, 1:24 AM EDT
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:
linkButton1.LinkCliked+=new LinkButtonLinkClickedEventArgs(linkButton1.Clicked) private void linkButton1_LinkClicked(object sender, System.Windows.Forms.LinkButtonLinkClickedEventArgs e) { //code here for the event..... }