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
460
Applying filters on webdatagrid results in object reference error
posted

Good day,

I have a webdatagrid on my page and have a datasource for it as object list. The code is like this:

        private List<AccommodationPrio> GetPrioritiesSelectionData()
        {
            GoGoYield_Entities entities = Master.GetEntities();
            int? intBrandId = (int?)GetSelectedBrandId();

            List<AccommodationPrio> result = (List<AccommodationPrio>)Session["AccommodationPrios"];

            if (result == null)
            {
                System.Linq.IOrderedQueryable<AccommodationPrio> query = Master.GetEntities().AccommodationPrios.OrderBy(p => p.Priority.Value); //.Include("Accommodation")
                result = query.ToList();
                Session["AccommodationPrios"] = result;
            }

            return result;
        }

and the aspx:

 

<ig:WebDataGrid ID="wdgPriorities" runat="server" AutoCRUD="true" AutoGenerateColumns="False" DataKeyFields="BrandId,AccommodationId"
                        CssClass="margin1pct" Width="98%" OnLoad="wdgPriorities_onLoad"
                        Height="650px"
                        oninitializerow="wdgPriorities_InitializeRow">
                        <Behaviors>
                            <ig:Filtering AnimationEnabled="True">
                            </ig:Filtering>
                            <ig:ColumnResizing Enabled="true">
                                <ColumnSettings>
                                    <ig:ColumnResizeSetting EnableResize="true" />
                                </ColumnSettings>
                            </ig:ColumnResizing>
                            <ig:EditingCore>
                                <Behaviors>
                                    <ig:CellEditing>
                                        <EditModeActions EnableOnActive="True" EnableOnKeyPress="True"
                                            MouseClick="Single" />
                                        <ColumnSettings>
                                            <ig:EditingColumnSetting ColumnKey="Priority" ReadOnly="true" />
                                        </ColumnSettings> 
                                    </ig:CellEditing>
                                </Behaviors>
                            </ig:EditingCore>
                        </Behaviors>
                    </ig:WebDataGrid>

When applying a filter on one of the colums the first time it works fine. The second time i apply the same (or other) filter on a column it results in the following error:

[NullReferenceException: Object reference not set to an instance of an object.] Infragistics.Web.UI.GridControls.JsTypeResolver.ResolveTypeId(Type type) +887 Infragistics.Web.UI.GridControls.ColumnFilter.set_ColumnKey(String value) +576 Infragistics.Web.UI.GridControls.ColumnFilter.LoadViewState(Object savedState) +189 Infragistics.Web.UI.Framework.ObjectBase.System.Web.UI.IStateManager.LoadViewState(Object state) +39 Infragistics.Web.UI.Framework.ObjectCollection.LoadViewStateItems(ArrayList itemList) +331 Infragistics.Web.UI.Framework.ObjectCollection.LoadViewState(Object savedState) +219 Infragistics.Web.UI.Framework.ObjectCollection.System.Web.UI.IStateManager.LoadViewState(Object savedState) +39 Infragistics.Web.UI.GridControls.Filtering.LoadViewState(Object savedState) +171 Infragistics.Web.UI.Framework.ObjectBase.System.Web.UI.IStateManager.LoadViewState(Object state) +39 Infragistics.Web.UI.Framework.ObjectCollection.LoadViewStateItems(ArrayList itemList) +331 Infragistics.Web.UI.Framework.ObjectCollection.LoadViewState(Object savedState) +219 Infragistics.Web.UI.Framework.ObjectCollection.System.Web.UI.IStateManager.LoadViewState(Object savedState) +39 Infragistics.Web.UI.GridControls.WebDataGrid.LoadViewState(Object savedState) +645 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +187 System.Web.UI.Control.LoadChildViewStateByID(ArrayList childState) +130 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +239 System.Web.UI.Control.AddedControl(Control control, Int32 index) +8901358 System.Web.UI.ControlCollection.Add(Control child) +79 Infragistics.Web.UI.LayoutControls.AJAXContentPane.InstantiateTemplate(Boolean ajax, Boolean dynamicUP, String triggerID, Boolean loadContent) +1572 Infragistics.Web.UI.LayoutControls.WebTab.InstantiateTemplates() +1181 Infragistics.Web.UI.LayoutControls.WebTab.CreateChildControls() +56 System.Web.UI.Control.EnsureChildControls() +102 System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +20 System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365 System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365 System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365 System.Web.UI.Page.FindControl(String id) +38 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +287 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +878

I have NetAdvantage 2010.2.

Do you have any ideas?

regards,

      René

Parents Reply Children
No Data