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):
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.
[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
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 !
After spending a lot of time trying to recreate the error on a small project so later I could send it to you, as requested, I was able to find the cause.
Setting the property Browser="Xml" will throw the exception mentioned before.
I found out about this by applying the following Skin:
<igtbl:UltraWebGrid runat="server" Browser="Xml" ImageDirectory="~/App_Themes/Default/Office2007Blue/WebGrid/"> <DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowDeleteDefault="Yes" AllowUpdateDefault="Yes" AllowSortingDefault="Yes" BorderCollapseDefault="Separate" CellClickActionDefault="RowSelect" CompactRendering="True" GridLinesDefault="NotSet" LoadOnDemand="Automatic" Name="ctl12xUltraWebGrid1" RowHeightDefault="20px" RowSelectorsDefault="No" SelectTypeRowDefault="Extended" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" ViewType="OutlookGroupBy" HeaderClickActionDefault="SortMulti" NoDataMessage ="No records were found"> <GroupByBox> <BandLabelStyle CssClass="igwgGrpBoxBandLblBlue2k7"> </BandLabelStyle> <Style CssClass="igwgGrpBoxBlue2k7"> </Style> </GroupByBox> <GroupByRowStyleDefault CssClass="igwgGrpRowBlue2k7"></GroupByRowStyleDefault> <ActivationObject BorderColor="181, 196, 223" BorderWidth=""> <BorderDetails WidthLeft="0px" WidthRight="0px" /> </ActivationObject> <RowExpAreaStyleDefault CssClass="igwgRowExpBlue2k7"></RowExpAreaStyleDefault> <FooterStyleDefault CssClass="igwgFooterBlue2k7"></FooterStyleDefault> <SelectedGroupByRowStyleDefault CssClass="igwgGrpRowSelBlue2k7"></SelectedGroupByRowStyleDefault> <RowStyleDefault CssClass="igwgRowBlue2k7" Cursor="Hand"> <BorderDetails WidthBottom="1px" WidthTop="1px" /> <Padding Left="3px" /> </RowStyleDefault> <FilterOptionsDefault AllowRowFiltering="OnServer" FilterUIType="FilterRow" FilterComparisonType="CaseInsensitive" RowFilterMode="AllRowsInBand" > <FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px"> <Padding Left="2px" /> </FilterOperandDropDownStyle> <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White"> </FilterHighlightRowStyle> <FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px" Width="200px"> <Padding Left="2px" /> </FilterDropDownStyle> </FilterOptionsDefault> <RowSelectorStyleDefault CssClass="igwgRowSlctrBlue2k7"></RowSelectorStyleDefault> <FixedHeaderStyleDefault CssClass="igwgHdrFxdBlue2k7"></FixedHeaderStyleDefault> <SelectedRowStyleDefault CssClass="igwgRowSelBlue2k7"></SelectedRowStyleDefault> <HeaderStyleDefault CssClass="igwgHdrBlue2k7" Height="23px"></HeaderStyleDefault> <RowAlternateStyleDefault CssClass="igwgRowAltBlue2k7"></RowAlternateStyleDefault> <Images ImageDirectory="~/App_Themes/Default/Office2007Blue/WebGrid/"> </Images> <SelectedHeaderStyleDefault CssClass="igwgHdrSelBlue2k7"></SelectedHeaderStyleDefault> <FormulaErrorStyleDefault CssClass="igwgFormulaErrBlue2k7"></FormulaErrorStyleDefault> <EditCellStyleDefault CssClass="igwgCellEdtBlue2k7"></EditCellStyleDefault> <FrameStyle CssClass="igwgFrameBlue2k7" Width="100%" Height="300px"></FrameStyle> <FixedCellStyleDefault CssClass="igwgCellFxdBlue2k7"></FixedCellStyleDefault> <FixedFooterStyleDefault CssClass="igwgFtrFxdBlue2k7"></FixedFooterStyleDefault> <Pager AllowPaging="True" PageSize="100" StyleMode="PrevNext" > <Style CssClass="igwgPgrBlue2k7"></Style> </Pager> <AddNewBox Hidden="False" Prompt="Add" View="Compact" > <ButtonStyle CssClass="igwgAddNewBtnBlue2k7"></ButtonStyle> <Style CssClass="igwgAddNewBoxBlue2k7"></Style> </AddNewBox> </DisplayLayout></igtbl:UltraWebGrid>
Let me know if you still need me to send you the project.
THANKS !
Hi, I'm not able to reproduce the problem, I'm sending you PM with my email, please reply with the project attached including sample DB if possible.
-Nick