When I move tasks around it ends up with an error. Especially when I move a task to an earlier point in time.
The problem is: Telerik (let's call it like that) updates automaticly, but a NULL-value is assigned to a random record in the Expanded column.
And the Gantt doesn't allow this value because its a bit so. 1 or 0
Help please.
7 Answers, 1 is accepted
Would you please try to recreate this issue on our online demos? As demonstrated in this screencast, no errors are thrown when moving an event forwards and backwards.
If the erroneous behavior is not reproduced in our demos, would you please create a very simplified sample runnable project that represents the issue and send it to us? Thus, we would be able to investigate locally and help you more efficiently.
Regards,
Peter Milchev
Telerik by Progress
Hello Peter,
Well, to your suprise maybe but I don't do anything special. I drag and drop a Gantt to my page.
I do exactly what your instructions show in the 'manual'.
Next, I have remove the most of the sql-instructions and end up with only this:
<asp:SqlDataSource
ID="TasksDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:SchedulerConnectionString %>"
SelectCommand="SELECT * FROM [GanttTasks]"
UpdateCommand="UPDATE [GanttTasks] SET [ParentID] = @ParentID, [OrderID] = @OrderID, [Title] = @Title, [Start] = @Start, [End] = @End, [PercentComplete] = @PercentComplete, [Expanded] = @Expanded, [Summary] = @Summary WHERE [ID] = @ID" DeleteCommand="DELETE FROM [GanttTasks] WHERE [ID] = @ID" InsertCommand="INSERT INTO [GanttTasks] ([ParentID], [OrderID], [Title], [Start], [End], [PercentComplete], [Expanded], [Summary]) VALUES (@ParentID, @OrderID, @Title, @Start, @End, @PercentComplete, @Expanded, @Summary)">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="ParentID" Type="Int32" />
<asp:Parameter Name="OrderID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="PercentComplete" Type="Decimal" />
<asp:Parameter Name="Expanded" Type="Boolean" />
<asp:Parameter Name="Summary" Type="Boolean" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ParentID" Type="Int32" />
<asp:Parameter Name="OrderID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="PercentComplete" Type="Decimal" />
<asp:Parameter Name="Expanded" Type="Boolean" />
<asp:Parameter Name="Summary" Type="Boolean" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource
ID="DependenciesDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:SchedulerConnectionString %>"
SelectCommand="SELECT * FROM [GanttDependencies]">
</asp:SqlDataSource>
<asp:SqlDataSource
ID="ResourcesDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:SchedulerConnectionString %>"
SelectCommand="SELECT * FROM [GanttResources]"></asp:SqlDataSource>
<asp:SqlDataSource
ID="AssignmentsDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:SchedulerConnectionString %>"
SelectCommand="SELECT * FROM [GantResourceAssignment]"></asp:SqlDataSource>
Then, we need a wide gannt so in the code behind we've added:
RadGantt1.RangeStart = DateTime.Now;
RadGantt1.RangeEnd = DateTime.Now.AddDays(90);
and, (found somewhere I don't remember where:
private const string TasksKey = "Telerik.GanttSample.Tasks";
private const string DependenciesKey = "Telerik.GanttSample.Dependencies";
We use a MS-SQL server 2016 express.
The RadGannt itself:
<telerik:RadGantt
ID="RadGantt1"
runat="server"
Skin="Silk"
RenderMode="Native"
DataSourceID="TasksDataSource"
DependenciesDataSourceID="DependenciesDataSource"
ResourcesDataSourceID="ResourcesDataSource"
AssignmentsDataSourceID="AssignmentsDataSource"
AutoGenerateColumns="False"
EnableResources="True"
AllowTaskDelete="False"
AllowTaskInsert="True"
AllowDependencyInsert="False"
AllowDependencyDelete="False"
AllowPercentCompleteDrag="False"
YearView-UserSelectable="true"
SelectedView="WeekView"
OnTaskUpdate="RadGantt1_TaskUpdate"
WeekView-DayHeaderDateFormat="dd/MM"
DayView-DayHeaderDateFormat="dd/MM"
MonthView-MonthHeaderDateFormat="dd/MM"
WeekView-WeekHeaderDateFormat="dd/MM">
<Localization HeaderDay="Dag" HeaderMonth="Maand" HeaderYear="Jaar" />
<Columns>
<telerik:GanttBoundColumn DataField="Title" DataType="String" HeaderText="Projecten" AllowSorting="false" AllowEdit="false" />
</Columns>
<DataBindings>
<TasksDataBindings
IdField="ID"
ParentIdField="ParentID"
StartField="Start"
EndField="End"
OrderIdField="OrderID"
SummaryField="Summary"
TitleField="Title"
PercentCompleteField="PercentComplete"
ExpandedField="Expanded"
/>
<DependenciesDataBindings
TypeField="Type"
IdField="ID"
PredecessorIdField="PredecessorID"
SuccessorIdField="SuccessorID" />
<ResourcesDataBindings
IdField="ID"
ColorField="Color"
TextField="Name" />
<AssignmentsDataBindings
IdField="ID"
TaskIdField="TaskID"
UnitsField="Units"
ResourceIdField="ResourceID" />
</DataBindings>
</telerik:RadGantt>
And some managers:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
</telerik:RadStyleSheetManager>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
</asp:ScriptReference>
</Scripts>
</telerik:RadScriptManager>
That's it, not so different from the Original.
I hope you can help :-)
Thank you for sending us your project.
The "expanded" column is of type "bit" but it should allow nulls as per the Database Structure article. Please find attached the project we prepared based on the provided files. Adding the Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll to the Bin folder should be sufficient to run the project. Would you please check if it behaves correctly on your side also?
If the attached project is different than yours, would you please modify it so that it reproduces the error and send it back to us as an attachment in an official support ticket? Also, we would appreciate it if you could provide us more detailed steps for reproducing the issue.
Regards,
Peter Milchev
Telerik by Progress
Hello Peter, your atteched file has the same problem I face.
When moving stuff around, everything goes fine.
But when I collapse a main Task and another around it goes wrong.
I will send you screenshots and show what goes wrong.
pic 1: A 'main' Task with serveral Childs.
pic 2: created another Main task
pic 3. moving tasks around (works fine)
pic 4: Collapsing Main Task
pic 5 Showing Value in database column Expanded = True even after Collasing
Then I move the Task "TestTaks" around (important: this is the moment things go wrong)
pic 6 Showing of Error (Server Error in '/' Application.
pic 7 Showing Value in database column Expanded = NULL
Thank you for the clarifications and detailed steps.
We were able to observe the faulty behavior and we have logged it as a bug in our Telerik Ajax Feedback and Ideas portal where you could follow the bug status.
As a token of gratitude for identifying this issue I updated your Telerik points.
Regards,
Peter Milchev
Telerik by Progress