This is a migrated thread and some comments may be shown as answers.

Filtering in Hierarchy Question.

1 Answer 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Emir
Top achievements
Rank 1
Emir asked on 27 Sep 2011, 03:31 PM
Hello,

I have a quick question. I would like to know if it is possible to implement Column Filtering for Hierarchy Data using the NeedDataSource event and the Self-Referencing  method for generating the Hierarchy.

In the NeedDataSource event handler I have only this :

RadGrid1.DataSource = ClassLibrary1.Service.Getdata().Where(x => x.Monthdate == DateTime.Parse("2010-12-01 00:00:00.000"));


This returns a subset of my data and the Grid is displayed fine, with working sorting and paging and hierarchy browsing.

The problem occurs on Filtering, where a AsyncPostbackError exception event  is raised  with this information for the inner exception property :

        Message    "Object reference not set to an instance of an object."
        Stack Trace :
              
at Telerik.Web.UI.GridColumn.set_CurrentFilterValue(String value)
at Telerik.Web.UI.GridColumn.set_CurrentFilterValue(String value)
at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfte

I read that Hierarchy Filtering is not possible with the basic data binding method calling DataBind(). I am not using that method, so If you could tell me if the approach used is a correct one or the errors I'm getting are triggered by some other problem?


Thanks in Advance.

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 28 Sep 2011, 04:18 PM
Hi Emir,

This is not a common error when filtering a self-hierarchy grid, so we will need some more details in order to identify its cause. Can you paste your grid declaration and code-behind, so that we can look for any possible reasons for this issue?

Greetings,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Emir
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or