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

Gantt sqldatasource select command with where clause not working

2 Answers 91 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Iago
Top achievements
Rank 1
Iago asked on 12 Sep 2017, 08:11 AM

Hello,

I am using ASP NET AJAX Gantt contro with database provider. I have created a table according to documentation here: http://docs.telerik.com/devtools/aspnet-ajax/controls/gantt/data-binding/database-structure

It is a readonly control, only for display purposes, but I would like to filter rows in that table according to user selection (year selection is possible). I have just added a where clause:

  'where [Start] between @startInterval and  @endInterval
  and [End] between @startInterval and  @endInterval'

Even when I can see on Sqldatasource selectedEvent the affected rows >0 and fits the exact number of rows query should return, Gantt diagram displays empty.

If I remove the where clause, diagram displays perfectly. 

Is there anything I am not taking into account?

 

Thank you in advance

 

2 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 15 Sep 2017, 01:14 PM
Hello Iago,

One possible reason for the missing appointments is if the root appointment does not satisfy the condition in the Where clause. 

Please find attached a sample project where the "WHERE" clause is working as expected when the parent appointment meets the requirements.

Once you ensure that all appointments in the range have a valid ParentID, then they should be rendered as expected.

Regards,
Peter Milchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Iago
Top achievements
Rank 1
answered on 16 Oct 2017, 08:48 AM

Thanks for your help. I have finally got it working setting EnableCaching="false". I do not know exactly why, but it worked for me.

 

Tags
Gantt
Asked by
Iago
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Iago
Top achievements
Rank 1
Share this question
or