I am creating a grid dynamically within the Page_Init event. Within my grid I have a GridTemplateColumn that has a Textbox in it. In order to do this I created a GridTemplateColumn_TextBox class.
I want to add an event handler to the TextChanged event. I can do this from within my GridTemplateColumn_Textbox class and everything works fine (ie. AddHandler txtBox.TextChanged, AddressOf txtBox_TextChanged)
The problem is that I don't want to add it from within my class, because I want my class to be a very generic class that I can use whenever I want to add this particular GridTemplateColumn to a grid, but the particular event handler in question is very specific to one particular page.
Is there a way to get a reference to the Textbox within my GridTemplateColumn and add my event handler from within my page itself instead of the class?
Hopefully I'm clear as to what I'm trying to do. If not, please let me know.
Thanks.
Steve
I want to add an event handler to the TextChanged event. I can do this from within my GridTemplateColumn_Textbox class and everything works fine (ie. AddHandler txtBox.TextChanged, AddressOf txtBox_TextChanged)
The problem is that I don't want to add it from within my class, because I want my class to be a very generic class that I can use whenever I want to add this particular GridTemplateColumn to a grid, but the particular event handler in question is very specific to one particular page.
Is there a way to get a reference to the Textbox within my GridTemplateColumn and add my event handler from within my page itself instead of the class?
Hopefully I'm clear as to what I'm trying to do. If not, please let me know.
Thanks.
Steve