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

RadComboBox Object Reference error

2 Answers 295 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jayzle
Top achievements
Rank 1
Jayzle asked on 09 May 2013, 05:41 AM
I am getting this error after I reset the values of the controls including RadComboBox.
Here's the scenario:

1. I have asp.net controls including dropdownlist, textbox and 2 RadComboBox
2. First RadComboBox = source depends on asp.net dropdownlist selected value
3. Second RadComboBox = source depends on First RadComboBox selected value
4. ASP.NET dropdownlist and First RadComboBox are set to autopostback=true and have selectedindexchanged events
5. Has an asp.net button "Reset" to reset/clear the values for the controls

Error occurs when I select an item on ASP.NET dropdownlist after OnClick event of reset button
Below is the error I got on our log file since when in debug mode, I just get a blank page

[09/05/2013 13:27:30][ERROR]:
    Message: Object reference not set to an instance of an object.
    Source: Telerik.Web.UI
    StackTrace:    at Telerik.Web.UI.RadComboBox.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.AddedControl(Control control, Int32 index)
   at System.Web.UI.ControlCollection.Add(Control child)
   at Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns)
   at Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
   at Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead)
   at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
   at System.Web.UI.Control.EnsureChildControls()
   at Telerik.Web.UI.GridTableViewBase.get_Controls()
   at Telerik.Web.UI.GridTableView.GetGridTable()
   at Telerik.Web.UI.RadGrid.PrepareRowsVisibility(GridTableView view)
   at Telerik.Web.UI.RadGrid.PrepareItems()
   at Telerik.Web.UI.RadGrid.ControlPreRender()
   at Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Notes:
  • I already remove the partial postback (radajaxmanager)
  • I retain the event for asp.net dropdownlist and radcombobox event but commented all codes inside it so it will just postback and no code will be executed

OnClick event has below code: (I also tried commenting the part of the 2 RadComboBox which are: ddlFailureCategory and ddlFailureSubCategory but still get error)

txtCaseNo.Text = string.Empty;
this.IsFirstLoad = true;
 
chkICAR.SelectedValue = "No";
chk8D.SelectedValue = "No";
chkReassignAccept.SelectedValue = "No";
chkReassignReject.SelectedValue = "No";
chkRevertActionItem.SelectedValue = "No";
chkReopenCase.SelectedValue = "No";
chkAutoRaise.SelectedValue = "No";
chkActivateCase.SelectedValue = "No";
 
ddlStatus.SelectedIndex = -1;
ddlModule.SelectedIndex = -1;
ddlFailureCategory.SelectedIndex = -1;
ddlFailureSubCategory.SelectedIndex = -1;
ddlCaseType.SelectedIndex = -1;
ddlTechnology.SelectedIndex = -1;
ddlOwnershipGroup.SelectedIndex = -1;
 
ddlCondCaseNo.SelectedIndex = -1;
ddlCondStatus.SelectedIndex = -1;
ddlCondModule.SelectedIndex = -1;
ddlCondFailureCategory.SelectedIndex = -1;
ddlCondFailureSubCategory.SelectedIndex = -1;
ddlCondCaseType.SelectedIndex = -1;
ddlCondTech.SelectedIndex = -1;
ddlCondOwnershipGroup.SelectedIndex = -1;
ddlCondCaseICAR.SelectedIndex = -1;
ddlCondCase8D.SelectedIndex = -1;
ddlCondReassignAccept.SelectedIndex = -1;
ddlCondReassignReject.SelectedIndex = -1;
ddlCondRevertActionItem.SelectedIndex = -1;
ddlCondReopenCase.SelectedIndex = -1;
ddlCondAutoRaise.SelectedIndex = -1;
ddlCondActivateCase.SelectedIndex = -1;
 
txtCaseNo.Enabled = false;
ddlStatus.Enabled = false;
ddlModule.Enabled = false;
ddlFailureCategory.Enabled = false;
ddlFailureSubCategory.Enabled = false;
ddlCaseType.Enabled = false;
ddlTechnology.Enabled = false;
ddlOwnershipGroup.Enabled = false;
 
chkICAR.Enabled = false;
chk8D.Enabled = false;
chkReassignAccept.Enabled = false;
chkReassignReject.Enabled = false;
chkRevertActionItem.Enabled = false;
chkReopenCase.Enabled = false;
chkAutoRaise.Enabled = false;
chkActivateCase.Enabled = false;

Kindly give an advice on how to interpret the error I got since in debug mode, I didn't get an exception.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 14 May 2013, 07:19 AM
Hi Jayzle,

You can refer to this forum thread where similar issue have been discussed.

If it is not useful in your case would you please share the exact code that will reproduce the issue if you use just one or two RadComboBox and a button so we could inspect it locally and be more helpful.

Greetings,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jayzle
Top achievements
Rank 1
answered on 14 May 2013, 07:29 AM
Hi Plamen,

I think the cause of the error is when I reset the selected item on the radcombobox (during reset button click)
I just use another way by combining client and server side (for the radcombobox) during reset button click.
With that, I didn't encounter any error. Thanks for your help.

Regards,
Jayzle
Tags
ComboBox
Asked by
Jayzle
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Jayzle
Top achievements
Rank 1
Share this question
or