Hello,
I have derived the a web server control from the datagrid control. Now I am adding an ItemTemplate to that grid dynamically via the LoadTemplate method. It looks like this:
Dim objtc As New TemplateColumn
objtc.ItemTemplate = Page.LoadTemplate("~/templates/expandcollapse.ascx")
Columns.Add(objtc)
The ascx page looks like this:
<asp:ImageButton id="btnExpand" runat="server" ImageUrl="~/Images/Plus.gif"></asp:ImageButton>
Now in my webform, where I use this control, I have a ItemCommand method, which should exexute, when somebody presses the button. Unfortunaly the method is never executed. When I press the button, then it postsback, and the screen doesnt show the grid anymore.
Anybody can help me out?
Thanks