Is it possible to add a GridTemplateColumn to a grid using the init or load event of the code behind page? My problem is that I add the coumn in design, but if I change the datasource and get the grid to refresh itself in the designer, my custom GridTemplateColumn columns get removed
thx
Bobby
3 Answers, 1 is accepted
0
Daniel
Telerik team
answered on 23 Jan 2009, 04:45 PM
Hello Bobby,
Please examine the following document: Programmatic creation
You need to scroll down a bit until you reach the "Creating template columns programmatically" section.
Let us know if you need more information.
Best regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for the reply, just trying it now. I've noticed a mistake on the VB code in the listing however. The class MyTemplate has a method called InstantiateIn, but it hasn't got the implements on the end:
PublicSub InstantiateIn(ByVal container As System.Web.UI.Control)
should be:
Public
Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
0
Daniel
Telerik team
answered on 27 Jan 2009, 03:15 PM
Hello Bobby,
Thank you for your suggestion.
I already corrected the mentioned line. The updated article should be online soon.
I also updated your Telerik points as a sign of gratitude.
Regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.