Filtering data and loading issue - scheduler for web forms

Hello
I followed the instructions to setup the simple ASP.NET calendar for web form.
I can see the scheduler, but getting an error “An unhandled exception of type ‘System.StackOverflowException’ occurred in mscorlib.dll” that stops at the line context.Response.Write" - in Data.ashx.cs.
I would also need to know how to filter records before loading into scheduler. I’m assuming that data is auto-filtered by dates, but I need to filter the data by center as well. Data is stored in SQL and I have setup Linq to SQL connection to the table with the data.
Tried to setup a table exactly the same way as in instructions, as an experiment, instead of using mine. It still stops, but at the different point. Sys.WebForms.PageRequestManager, _endPostBack, endrequest handler. The actual message - unhandled exception MsAjaxJs? Object reference not set to an instance of an object. The code I have is identical to your sample, the only difference that the Scheduler is located on one of the tabs of Ajax TabContainer. If I press continue, it opens the page and I can add new event, press save - no errors. It displays newly added events, but doesn’t save it back to SQL. It doesn’t display 2 test events that I added manually in SQL - at all…

Hello,
StackOverflowException exception may be caused by cyclic relations in Model classes. You need to either to define an intermediate data class that could be serialized into JSON and use it to data operations, or use ‘ignore’ attributes of dhtmlxScheduler .NET
Please check this thread viewtopic.php?f=25&t=49897&p=138136&hilit=StackOverflowException#p138136

You can filter data on a backend, before you provide it to SchedulerAjaxData interface. Since the data selection is done in your code, you can apply any filtering rules. scheduler-net.com/docs/filtration.html
Alternatively, you can filter data via client-side API docs.dhtmlx.com/scheduler/filtering.html

Thank you for your reply. I believe that StackOverflowException error happens because my field names in the SQL table do not match the names suggested in your tutorial example. For example I do not have start_date field or id in my sql table. Does it mean that I have to name the fields in SQL table the same way as in your samples?
What is the command to ignore the attributes?
As for filtering - I need to filter events based on the location. I need to store location for each event in SQL and based on the user - different user would get the specific location or have a choice of the locations to see. So I can’t do it on a back end. I looked at the examples and filtering is done by the event. Can I use custom fields to filter by and still use your scheduler or is it not possible? Saw another example for filtering, but it is done for MVC, I use web forms. How should I change it?
I appreciate your help!

Hi,

That would call a client side error when js scheduler could not find a required properties of events that came from the server side.
StackOverflowException is usually caused by cyclic links in a data collection

Please check these articles:
scheduler-net.com/docs/loading-d … the_client
scheduler-net.com/docs/loading-d … properties

Regarding the filters - you can do it either on a backend or on a front-end, there is really no fundamental difference, except for the raw amount of events loaded to the client.
If you do server side filtering - you can clear the scheduler and request data loading from the client-side:

scheduler.clearAll(); scheduler.load("Data.ashx?location_id=4", "json");
And on a backend you filter data collection as required, using the request values

Or if you do client-side filtering - docs.dhtmlx.com/scheduler/filtering.html - you define several js functions, one for each mode of the scheduler. Each time event is going to be rendered, scheduler will call an appropriate filtering function providing the appropriate event as an argument. Event will be displayed if filter returns ‘true’ and hidden otherwise, so there is no limitation on filtering criteria