0

I am creating RadTreeView nodes dynamically and I have created it successfully.But When I try to Add a sub-category node to it,sub-category is added successfully but at the end when I am reloading tree I am getting this error:

Object reference not set to an instance of an object.

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadComboBox.OnInit(EventArgs e) +40
   System.Web.UI.Control.InitRecursive(Control namingContainer) +134
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +191
   System.Web.UI.ControlCollection.Add(Control child) +86
   Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns) +23849
   Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +170
   Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead) +93
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1156
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +679
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +149
   System.Web.UI.Control.EnsureChildControls() +83
   Telerik.Web.UI.GridTableViewBase.get_Controls() +15
   Telerik.Web.UI.GridTableView.GetGridTable() +15
   Telerik.Web.UI.RadGrid.PrepareRowsVisibility(GridTableView view) +33
   Telerik.Web.UI.RadGrid.PrepareItems() +308
   Telerik.Web.UI.RadGrid.ControlPreRender() +64
   Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e) +41
   System.Web.UI.Control.PreRenderRecursiveInternal() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974

Dont understand this I tried to debug my code using debug point but everthing is executed alright but at the end I am getting this error.

1
  • Do you have some code to go with this error? Commented Dec 2, 2013 at 19:14

2 Answers 2

3

yes after a long research on my code I got the answer that my grid was getting referenced to null.But its very sad that this is such a famous forum but no one was able to understand the stack trace.

Sign up to request clarification or add additional context in comments.

1 Comment

Then what did you change in your code that solved your problem?
0

I had this issue after a postback with a radgrid, the problem was the Datasourse was null. To fix it you only have to set DataSource = ""

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.