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
pranahethaPosted May 29, 2006, 5:24 AM
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.....
}