Rank: Advanced Member Groups: Member
Joined: 9/14/2009 Posts: 29
|
Support,
I am having a NullReferenceException issue regarding your grid control while implementing a very simple web page in our web application.
What is driving me crazy is the fact that I implemented in our same web application a much more complicated web page using your grid and I was very impressed with your control; I used textbox columns, custom columns with dropdown lists, lots of client-side events, etc.
In the problem simple web page where I am using your grid, I have one static column and one texbox column and, in order to edit info in the texbox cell, FullRowMode set to false. I also have two ASP submit buttons (save and cancel) on the page that will generate a postback. In the Page Load event I assign my data source and the info is rendered correctly.
The issue is, if I simply click into a texbox cell (grid goes into edit mode) and then click on one of my ASP buttons that should generate a postback, NO postback is generated (page load event and button event does not fire). Instead I get a NullReferenceException thrown which I have listed below. What is strange, is the error does not occur if I FIRST click one of my buttons (which generates an inital postback) and then click into the textbox cell. In fact, once I initially click one of my buttons I can go back and forth as many times as I want clicking into the textbox edit cell and clicking one of my buttons.
Is there some setting on the grid that I may have forgotten about since my first implementation? I could not see any differences that really stood out.
If it ends up being some kind of issue on your side, due to our client base, we would prefer not to upgrade at this time unless a specific fix addresses this issue. We are currently using version 7.0 (2009).
Below is the exception stack, the asp page listing, and my page load event for your review:
[NullReferenceException: Object reference not set to an instance of an object.] EO.Web.Internal.c7.a(h9[] A_0) +858 EO.Web.Internal.c7.a(h9 A_0) +876 EO.Web.Internal.bt.aa() +352 EO.Web.WebControlBase.a(Object A_0) +71 EO.Web.Grid.a(Object A_0) +13 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +183 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221 System.Web.UI.Page.LoadAllState() +312 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1661
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ItemRptCategoryMaint.aspx.cs" Inherits="HQWeb.Pages.ItemRptCategoryMaint" %> <%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %> <%@ Register TagPrefix="uc1" TagName="PageHeaderTitle" Src="~/Controls/PageHeaderTitle.ascx" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> </head> <body> <form ID="form1" runat="server"> <table width="100%"> <tr> <td> <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" /> </td> <td> <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" /> </td> <td align="left">
<eo:Grid ID="gItemRptCategoryGrp1" runat="server" BorderColor="Black" BorderWidth="1px" ColumnHeaderAscImage="00050403" ColumnHeaderDescImage="00050404" ColumnHeaderDividerImage="00050402" ColumnHeaderDividerOffset="6" ColumnHeaderHeight="18" FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="9pt" Font-Strikeout="False" Font-Underline="False" GridLineColor="240, 240, 240" GridLines="Both" Height="200px" ItemHeight="18" Width="395px" FullRowMode="False"> <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" /> <ItemStyles> <eo:GridItemStyleSet> <ItemStyle CssText="background-color: white" /> <CellStyle CssText="padding-left:8px;padding-top:2px; color:#black;white-space:nowrap;" /> </eo:GridItemStyleSet> </ItemStyles> <ColumnTemplates> <eo:TextBoxColumn> <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" /> </eo:TextBoxColumn> <eo:DateTimeColumn> <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter" DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL" TitleRightArrowImageUrl="DefaultSubMenuIcon"> <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" /> <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" /> <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" /> <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" /> <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" /> <TitleArrowStyle CssText="cursor:hand" /> <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" /> <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" /> <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" /> <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" /> <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" /> <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" /> </DatePicker> </eo:DateTimeColumn> <eo:MaskedEditColumn> <MaskedEdit ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;"> </MaskedEdit> </eo:MaskedEditColumn> </ColumnTemplates> <Columns> <eo:StaticColumn DataField="CategoryNumber" Name="CategoryNumber"> </eo:StaticColumn> <eo:TextBoxColumn DataField="Description" HeaderText="xxDescription" Name="Description" Width="301"> </eo:TextBoxColumn> </Columns> <ColumnHeaderStyle CssText="background-image:url('00050401');padding-left:8px;padding-top:2px;" /> </eo:Grid> </td> </tr> </table> </form> </body> </html>
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gItemRptCategoryGrp1.DataSource = ReportCategory.GetDataSource(); gItemRptCategoryGrp1.DataTable = "MyTestTable"; gItemRptCategoryGrp1.DataBind(); } }
protected void btnSave_Click(object sender, EventArgs e) {
}
protected void btnCancel_Click(object sender, EventArgs e) {
}
THANK YOU VERY MUCH IN ADVANCE,
TOM
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We are not able to run your page because it references other elements in your code. However this appears to be a bug that has been fixed. We have sent you the download location of the last build that your license covers, so you may want to try that build and see if it fixes the problem.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 9/14/2009 Posts: 29
|
I'll give it a shot.
Thanks very much,
Tom
|
Rank: Advanced Member Groups: Member
Joined: 9/14/2009 Posts: 29
|
Hello,
As per your suggestion, I upgrated from version 7.0 (2009) to version 8 (8.0.26.2) and the problem still exists.
Is there a newer version I could try that does not cost me anything for a new license?
I'll continue to troubleshoot and see if our application is doing anyting with the viewstate, session state, etc. that could be causeing your control to have problems.
Thanks,
Tom
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
8.0.26 is recent enough. Can you try to isolate the problem into a test page? As soon as we have that we can try to run it in our test environment and as soon as we see it happens in our environment, we should be able to tell you why.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 9/14/2009 Posts: 29
|
Hi,
Good news! Your grid control is working just fine as I thought it would be since I had great success with it previously; it really is a great control.
I found out that our application pages must implement this third party breadcrumb control that is implemented in master pages. This control appears to do a lot with the view state. Once I met our application requirement to include this missing bread crumb control in my page, the issue completely went away.
Sorry for the wild goose chase on this!
I Appreciate your great support and thanks agein,
Tom
|