We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Exception using FilterBar

Hi,

I am using the GridGroupingControl to display the results of an object data source, the object data source is a List<> of Project objects.

I have the grid bound and sorting, column resizing and column reordering is working without problem. However, i recently have the requirement to provide filters, i have set the TableDescriptoe.AllowFilter property to True, but i am getting the following error.

Viasys.Core.Diagnostics.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.CreateClientFilterObject(StringBuilder stb, GridTableDescriptor gtd) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.AddGridTablesScript(StringBuilder stb, ChildTable ctable, String tdId, String clientObjectId) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.CreatePropertyInitingStartupScript(StringBuilder stb, String clientObjectId) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.GetClientObjectPropertySettingScript() at Syncfusion.Web.UI.WebControls.CallbackDataBoundControl.Syncfusion.Web.UI.WebControls.ISFCallbackControl.GetClientObjectPropertySettingScript() at Syncfusion.Web.UI.WebControls.CallbackControlEnabler.GetClientObjectPropertySettingScript() at Syncfusion.Web.UI.WebControls.CallbackControlEnabler.GetStartupScript() at Syncfusion.Web.UI.WebControls.CallbackControlEnabler.OnPreRender(EventArgs e) at Syncfusion.Web.UI.WebControls.CallbackDataBoundControl.OnPreRender(EventArgs e) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

This is occurring when the grid is loading and i am not able to get the filter bar to display at all. I read an article about permissions and have given ASPNET, NETWORK SERVER, and Everyone full control over the application folder.

I you require any further information please do not hesitate to ask.

Regards
Neil



3 Replies

RP Rekha P Syncfusion Team March 12, 2009 10:30 AM UTC

Hi Neil,

Thank you for your interest in Syncfusion Products.

The issue reported by you, can be obtained when AllowFilter is enabled in TableDescriptor when ItemTemplate is defined. If the page contains ItemTemplates, then FilterBar should be enabled programmatically from code behind file. Please refer the sample below which illustrates this.

http://files.syncfusion.com/support/GGC.Web/7.1.0.30/F80072/main.htm

The Filtering mechanism work flow is as follows.

When a data source is set for a Grid and while rendering the data in each column will be read and the unique data will be populated to the filter combo box. Hence AllowFilter should be removed from TableDescriptor and should be enabled for the appropriate columns in code behind file. Please refer the code snippet to achieve this.

[ASPX]

AutoFormat="Office 2007 Blue" DataSourceCachingMode="viewState" ShowGroupDropArea="false">


....





[C#]

protected void Page_Load(object sender, EventArgs e)
{
this.GridGroupingControl.TableDescriptor.Columns[0].AllowFilter = true;
this.GridGroupingControl.TableDescriptor.Columns[1].AllowFilter = true;
this.GridGroupingControl.TableDescriptor.Columns[2].AllowFilter = true;
}

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Please let me know if you have any other concerns.

Thanks,
Rekha



BB Brian Burnett May 4, 2009 01:05 PM UTC

The AllowFilter property has been made obsolete as of 7.2.0.19 and I'm gettting this error. How do I fix it?


>Hi,

I am using the GridGroupingControl to display the results of an object data source, the object data source is a List<> of Project objects.

I have the grid bound and sorting, column resizing and column reordering is working without problem. However, i recently have the requirement to provide filters, i have set the TableDescriptoe.AllowFilter property to True, but i am getting the following error.

Viasys.Core.Diagnostics.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.CreateClientFilterObject(StringBuilder stb, GridTableDescriptor gtd) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.AddGridTablesScript(StringBuilder stb, ChildTable ctable, String tdId, String clientObjectId) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.CreatePropertyInitingStartupScript(StringBuilder stb, String clientObjectId) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.GetClientObjectPropertySettingScript() at Syncfusion.Web.UI.WebControls.CallbackDataBoundControl.Syncfusion.Web.UI.WebControls.ISFCallbackControl.GetClientObjectPropertySettingScript() at Syncfusion.Web.UI.WebControls.CallbackControlEnabler.GetClientObjectPropertySettingScript() at Syncfusion.Web.UI.WebControls.CallbackControlEnabler.GetStartupScript() at Syncfusion.Web.UI.WebControls.CallbackControlEnabler.OnPreRender(EventArgs e) at Syncfusion.Web.UI.WebControls.CallbackDataBoundControl.OnPreRender(EventArgs e) at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

This is occurring when the grid is loading and i am not able to get the filter bar to display at all. I read an article about permissions and have given ASPNET, NETWORK SERVER, and Everyone full control over the application folder.

I you require any further information please do not hesitate to ask.

Regards
Neil






RP Rekha P Syncfusion Team May 7, 2009 11:29 AM UTC

Hi Neil,

The AllowFilter property is deprecated since this property produces issues internally. We would suggest you to work with this property with the warning, and we will let you know once the issue is fixed and the property becomes live.

You can run the sample successfully with this warning and please refer the sample below in version 7.2.0.19 using AllowFilter property enabled at code behind when ItemTemplate is used.

http://files.syncfusion.com/support/GGC.Web/7.2.0.19/F80072/main.htm

Please let me know if you have any concerns.

Thanks,
Rekha

Loader.
Live Chat Icon For mobile
Up arrow icon