This will crash (however this construction is allowed in standart asp.net grid component):
System crashes on Databind with long message
That took some time to me to find the reason of the problem (my current grid is quite complex)
User just need to add empty ItemTemplate. However, it was not easy to find the reason
| <telerik:GridTemplateColumn Visible="false"> |
| <EditItemTemplate> |
| <asp:DropDownList ID="ddCategory" Runat="server" CssClass="GeneralDropDownList"></asp:DropDownList> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
System crashes on Databind with long message
| System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. |
| at Telerik.Web.UI.GridTemplateColumn.FillValues(IDictionary newValues, GridEditableItem editableItem) |
| at Telerik.Web.UI.GridEditableItem.ExtractValues(IDictionary newValues) |
| at Telerik.Web.UI.GridTableView.ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem) |
| at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) |
| at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) |
| at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) |
| at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) |
| at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) |
| at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) |
| at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) |
| at System.Web.UI.WebControls.DataBoundControl.PerformSelect() |
| at Telerik.Web.UI.GridTableView.PerformSelect() |
| at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() |
| at Telerik.Web.UI.GridTableView.DataBind() |
| at Telerik.Web.UI.RadGrid.DataBind() |
| at System.Web.UI.Control.DataBindChildren() |
| at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) |
| at System.Web.UI.Control.DataBind() |
| at System.Web.UI.Control.DataBindChildren() |
| at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) |
| at System.Web.UI.Control.DataBind() |
| at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) |
| at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode) |
| at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) |
| at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) |
| at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) |
| at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) |
| at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) |
| at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) |
| at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) |
| at System.Web.UI.WebControls.DataBoundControl.PerformSelect() |
| at Telerik.Web.UI.GridTableView.PerformSelect() |
| at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() |
| at Telerik.Web.UI.GridTableView.DataBind() |
| at Telerik.Web.UI.RadGrid.DataBind() |
| at Sleza4eEngine.LRMup.controls.components.BFfamily.AttachmentsControl.LoadGrid(Boolean AddNew) in D:\Sleza4e\Job\SourceCode\lrmup\src\LRMup\controls\components\BFfamily\main\AttachmentsControl.ascx.cs:line 71 |
| at Sleza4eEngine.LRMup.controls.components.BFfamily.AttachmentsControl.processData(XmlNode dataNode) in D:\Sleza4e\Job\SourceCode\lrmup\src\LRMup\controls\components\BFfamily\main\AttachmentsControl.ascx.cs:line 32 |
| at Sleza4eEngine.LRMup.controls.content.file.LoadGroups(Boolean FilePostBack) in D:\Sleza4e\Job\SourceCode\lrmup\src\LRMup\controls\content\file.ascx.cs:line 329 |
| at Sleza4eEngine.LRMup.controls.content.file.Page_Load(Object sender, EventArgs e) in D:\Sleza4e\Job\SourceCode\lrmup\src\LRMup\controls\content\file.ascx.cs:line 210 |
| at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) |
| at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) |
| at System.EventHandler.Invoke(Object sender, EventArgs e) |
| at System.Web.UI.Control.OnLoad(EventArgs e) |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Control.LoadRecursive() |
| at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
| --- End of inner exception stack trace --- |
| at System.Web.UI.Page.HandleError(Exception e) |
| at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
| at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
| at System.Web.UI.Page.ProcessRequest() |
| at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) |
| at System.Web.UI.Page.ProcessRequest(HttpContext context) |
| at ASP.start_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a159c958\db1b23ec\App_Web_start.aspx.cdcab7d2.3eyik7my.0.cs:line 0 |
| at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() |
| at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) |
That took some time to me to find the reason of the problem (my current grid is quite complex)
User just need to add empty ItemTemplate. However, it was not easy to find the reason
| <telerik:GridTemplateColumn Visible="false"> |
| <ItemTemplate> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:DropDownList ID="ddCategory" Runat="server" CssClass="GeneralDropDownList"></asp:DropDownList> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |