Issue while trying to disable WebDataGrid RUNTIME
The grid that I’m using inherits the Infragistics.Web.UI.GridControls.WebDataGrid. The version of Infragistics is 2010 volume 3.
What happens in my case is, I try to disable my own Datagrid. Fortunately this does what it should do. The grid greys out just like I want. The problem is however, when I click a button to enable it again, an exception is thrown.
This has been tested with the original Infragistics WebDataGrid but the exception does not occur. With the WebDataGrid I’m able to disable and enable it as much as I want.
So my questions are;
- Why is this happening?
- What causes the exception?
- How can I resolve this?
Below the code of my implementation of a WebDataGrid custom component:
public class Cx_Datagrid : Infragistics.Web.UI.GridControls.WebDataGrid
{
/// <summary>
/// Constructor
/// </summary>
public Cx_Datagrid()
{ }
}
And here is the complete exception that occurs when trying to enable the datagrid:
Serverfout in toepassing /AJAXEnabledWebSite1.
--------------------------------------------------------------------------------
De objectverwijzing is niet op een exemplaar van een object ingesteld.
Beschrijving: Er is een onverwerkte uitzondering opgetreden tijdens het uitvoeren van de huidige webaanvraag. Raadpleeg de stacktracering voor meer informatie over deze fout en de oorsprong ervan in de code.
Details van uitzondering: System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
Fout in bron:
Er is een onverwerkte uitzondering gegenereerd tijdens het uitvoeren van de huidige webaanvraag. Aan de hand van de onderstaande tracering van de uitzonderingsstack kunt u meer informatie verkrijgen over de oorsprong en de locatie van de uitzondering.
Stacktracering:
[NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.]
Infragistics.Web.UI.GridControls.ColumnResizing.LoadClientCollectionsTransactionList(Object[] collections) +83
Infragistics.Web.UI.Framework.ObjectBase.LoadTransactionList(Boolean deferLoadPostDataProcessing) +151
Infragistics.Web.UI.Framework.ObjectBase.Infragistics.Web.UI.IClientState.LoadTransationList(Boolean deferLoadPostDataProcessing) +40
Infragistics.Web.UI.GridControls.GridBot.LoadClientObjectsTransactionList() +88
Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent() +99
Infragistics.Web.UI.GridControls.GridBot.HandleRaisePostDataChangedEvent() +74
Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RaisePostDataChangedEvent() +34
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Versiegegevens: Microsoft .NET Framework Versie:2.0.50727.4206; ASP.NET Versie:2.0.50727.4209
Thanks in advance!
Hi JerryDK,
This sample was very helpful to diagnose the problem! Thanks. It actually was unrelated to the fact that it was a derived WebDataGrid. It was a bug in the framework. When you enable the grid, no transaction lists come back from the client and we tried to use it, but it was null. I added a check for that. This was submitted internally as bug 60169 and I've already fixed it. You can contact Developer Support open a support case and be notifed when this bug is fixed.
thanks,Dave
Hi David,
I added an attachment with this post which contains a sample VS project with only the inherited WebDataGrid on a plain ASPX page with two buttons to enable/disable in RUNTIME.
If u rather want it full posted within this topic, let me know!
I tried doing something similar to what you describe, but did not reproduce an exception. Could you post a full sample aspx and code-behind to show this behavior?
regards,
David Young