This is a migrated thread and some comments may be shown as answers.

Issue (with solution) when using GridTemplateColumn with EditItemTemplate without ItemTemplate

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luci
Top achievements
Rank 1
Luci asked on 24 Jul 2008, 08:45 AM
Hello
I've been searching for a strange bug, when using a column template, without defining the itemtemplate (i.e. defining only edititemtemplate), Grid Delete command doesn't work any more, it throws an exception like this:

Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

took me 4 hours to solve it, hope it helps somebody else.
always define <itemtemplate /> even if it's empty .

2 Answers, 1 is accepted

Sort by
0
Accepted
Veli
Telerik team
answered on 24 Jul 2008, 12:36 PM
Hello Viorel,

Thank you for the observation and the reminder. Indeed, when data source operations are implemented, RadGrid's GridTemplateColumn needs to have an <ItemTemplate> defined, although empty. This is because at some point the RadGrid's lifecycle, the ItemTemplate objects are referenced and they need to be initialized in any case.

Kind regards,
Veli
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Randy
Top achievements
Rank 1
answered on 21 Oct 2009, 04:57 PM
Thank you for specifying that every TemplateColumn requires an <ItemTemplate>.  That solved my delete error.
Tags
Grid
Asked by
Luci
Top achievements
Rank 1
Answers by
Veli
Telerik team
Randy
Top achievements
Rank 1
Share this question
or