User controls' events
Posted on 2009-06-29
I have written a user control containing a dropdown. On the user control I declare a delegate and an event 'OnSelectedIndexChangedDelegate' when changing the selected index.
I am using the user control in 1 aspx page successfully:
ctlLevel1.OnSelectedIndexChanged += new ddlToText.OnSelectedIndexChangedDelegate(ctlLevel1_OnSelectedIndexChanged);
But, when putting the user control within a griView TemplateField, I can't use it the way I did in the previous page because 'ctLevel1' is not recognized (it is contained within the gridView).
How can I use the user control events within the gridView?