Currently, the RadGantt allows only format strings as a value for the WeekHeaderDateFormat property. For example, allowing a template similar to Kendo Gantt:
Use case - show week number instead of the dates. Workaround to show week number: The suggestion is based on the https://demos.telerik.com/aspnet-ajax/gantt/examples/accessibility-and-internationalization/localization/defaultcs.aspx demo. What you should add to the Gantt markup declaration is the WeekView-WeekHeaderDateFormat="dd/MM/yyyy" and OnClientDataBound="OnClientDataBound" properties. // https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php function getWeekNumber(d) { // Copy date so don't modify original d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())); // Set to nearest Thursday: current date + 4 - current day number // Make Sunday's day number 7 d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7)); // Get first day of year var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); // Calculate full weeks to nearest Thursday var weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7); // Return array of year and week number // return [d.getUTCFullYear(), weekNo]; return weekNo } function OnClientDataBound(sender, args) { if (sender.get_viewsData()[sender.get_selectedView()].type == "week") { $telerik.$('.rgtTimelineWrapper thead>tr:first .radHeader', sender.get_element()).each(function (index) { var $this = $(this) var datestring = $this.text().substring(0, 10); var date = new Date(datestring); var weekNumber = getWeekNumber(date) $this.text("Week " + weekNumber) }) } }
Allow setting a client template for the task's tooltip. Workaround: https://www.telerik.com/support/code-library/custom-task-tooltip
Integrate validation of unique names that are being assigned through the UniqueName property of the GanttBoundColumn class to prevent the same assigned two times. E.g. RadGantt myGantt = new RadGantt(); GanttBoundColumn boundColumn = new GanttBoundColumn(); boundColumn.UniqueName = "Unique"; myGantt.Columns.Add(boundColumn); GanttBoundColumn boundColumn2 = new GanttBoundColumn(); boundColumn.UniqueName = "Unique"; // this should be validated myGantt.Columns.Add(boundColumn2);
Implement a string indexer or a method to get column by unique name in RadGantt. Example of string indexer // // Summary: This class represents collection of Telerik.Web.UI.GanttBoundColumn. // public class ColumnCollection : BaseCollection<GanttBoundColumn> { public ColumnCollection(){...} public ColumnCollection(IGantt owner){...} public GanttBoundColumn this[string ColumnName] { //considering columnCollection is internal variable holding list of columns. return columnCollection.Where(c => c.UniqueName == ColumnName).FirstOrDefault(); } } Example of a method can be similar to RadGrid's GetColumn and GetColumnSafe methods: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Common/using-the--getitems-getcolumn-and-getcolumnsafe-methods.
The task's get_customFieldClientName() and set_customFieldClientName(newValue) methods always work with the last custom field in the CustomFields collection. There are two workarounds until an official solution is available: - instead of the function getter, use task._data.customFieldClientName . The setter cannot be worked around that easily. This can work for you if you only show data or do not need to edit custom fields - OR, add the following function override at the end of the </form> - a sample is attached below <script> Telerik.Web.UI.RadGantt.prototype.initializeCustomFields = function () { var _createCustomFieldGetterAndSetter = function (fieldName) { var taskType = Telerik.Web.UI.GanttTask; taskType.prototype["get_" + fieldName] = function () { return this._data[fieldName]; }; taskType.prototype["set_" + fieldName] = function (value) { var updateInfo = {}; updateInfo[fieldName] = value; this._data[fieldName] = value; this._update(updateInfo); }; } var customFields = this.get_customTaskFields(); for (var i = 0, length = customFields.length; i < length; i++) { _createCustomFieldGetterAndSetter(customFields[i].clientPropertyName); } } </script>
In the attached project, if you try to reorder task 10 above task 6, both tasks will have the same OrderID.
The same is not observed if you reorder Task 4 to be above Task 1.
In DayView there should be an alternative option to see number of days the project is running. For example a project running for 6 months, the numbers should be shown from 1 to 180 days and progress to be displayed against those days.
Hello, this is for the list of columns on the left side of the Gantt, called TreeListView. If it would be possible to add additional columns that we select or implement during data binding, for example: Duration, other dates, description, task type, and many others that the client will select dynamically, so they must not be a static list of columns. Thank you, -Sam
Workaround - placing the following script after the ScriptManager: <script type="text/javascript"> Telerik.Web.UI.RadGantt.prototype.postback = function (args) { var postbackFunction = this.get_postBackReference().replace("arguments", Sys.Serialization.JavaScriptSerializer.serialize(args).replace(/\\/g, "\\\\").replace(/'/g, "\\'")); eval(postbackFunction); } </script>
In "Planned vs Actual" scenario, and we noticed a strange behaviour when we have same task Start and End date, and both planned dates null: in this case a circle ("planned" symbol) appears on the left side of gantt chart... but planned dates are null.
When task Start and End dates are different, and planned dates are null, the circle correctly does not appear.