Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1705
How to use WebNavBar
posted

Hey guys,

 

I have a grid in a web user control that implements:

 UltraWebGrid1.InitializeDataSource += new Infragistics.WebUI.UltraWebGrid.InitializeDataSourceEventHandler(UltraWebGrid1_InitializeDataSource);

UltraWebGrid1_InitializeDataSource queries the database, gets a datatable object and assigns it to the grid's datasource.

 everything works fine.

However if I add the WebNavBar

  <ignavbar:webnavbar id="WebNavBar1" runat="server"              >
  <Extension Visible="false" >             
  </Extension>          
  <Navigation Next-AutoPostBack="false" Prev-AutoPostBack= "false" End-AutoPostBack="false" Start-AutoPostBack="false" Rewind-AutoPostBack="false" FastForward-AutoPostBack="false" ></Navigation>
</ignavbar:webnavbar>  

 protected override void OnInit(EventArgs e)
  {   
    UltraWebGrid1.InitializeDataSource += new Infragistics.WebUI.UltraWebGrid.InitializeDataSourceEventHandler(UltraWebGrid1_InitializeDataSource);
    WebNavBar1.GridID = UltraWebGrid1.UniqueID;    
  } 

and click Reverse or Forward I would get the following exception (all other buttons work just fine):

 

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
Infragistics.WebUI.UltraWebGrid.RowsCollection.Infragistics.WebUI.UltraWebGrid.IXPathDataNavigable.GetFirstChild() +183
Infragistics.WebUI.UltraWebGrid.RowsCollection.Infragistics.WebUI.UltraWebGrid.IXPathDataNavigable.get_HasChildren() +32
Infragistics.WebUI.UltraWebGrid.XPathDataNavigator.OutputToStream(XPathDataNavigator xpdn, XmlTextWriter stream, HtmlTextWriter htmlWriter) +142
Infragistics.WebUI.UltraWebGrid.RenderXmlGrid.WriteBody(HtmlTextWriter writer, RowsCollection rows, Boolean topLevel) +112
Infragistics.WebUI.UltraWebGrid.RenderXmlGrid.WriteUltraWebGrid(HtmlTextWriter writer, UltraWebGrid grid, Boolean shouldWriteAll) +418
Infragistics.WebUI.UltraWebGrid.RenderXmlGrid.VisitObjects(HtmlTextWriter output) +603
Infragistics.WebUI.Shared.RendererBase.Render(HtmlTextWriter output) +36
Infragistics.WebUI.UltraWebGrid.GridRendererBase.Render(HtmlTextWriter output) +482
Infragistics.WebUI.UltraWebGrid.UltraWebGrid.Render(HtmlTextWriter output) +336
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +236
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +32
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
 

 

 

I had a similar problem with another grid and I solved it  reassigning the datasource to the grid on these events:


  onaftermovenext="WebNavBar1_Move"
  onaftermoveprev="WebNavBar1_Move"
  onaftermovetoend="WebNavBar1_Move"
  onaftermovetostart="WebNavBar1_Move"      

I haven't had the same luck with this grid.

 

Can somebody help please?

 

Thanks !